diff --git a/src/UI/Studio/EditItemButton.svelte b/src/UI/Studio/EditItemButton.svelte index 3d593f0a1..f5f1c1001 100644 --- a/src/UI/Studio/EditItemButton.svelte +++ b/src/UI/Studio/EditItemButton.svelte @@ -1,29 +1,30 @@ dispatch("layerSelected", info)}> @@ -32,6 +33,14 @@ {info.id} {#if info.owner && info.owner !== $selfId} - (made by {$displayName ?? info.owner}) + {#if $displayName} + (made by {$displayName} + {#if window.location.host.startsWith("127.0.0.1")} + - {info.owner} + {/if} + ) + {:else } + ({info.owner}) + {/if} {/if} diff --git a/src/UI/Studio/EditLayerState.ts b/src/UI/Studio/EditLayerState.ts index 75e821a9d..7a7d7f7ba 100644 --- a/src/UI/Studio/EditLayerState.ts +++ b/src/UI/Studio/EditLayerState.ts @@ -299,6 +299,9 @@ export default class EditLayerState extends EditJsonState { function cleanArray(data: object, key: string): boolean{ + if(!data){ + return false + } if (data[key]) { // A bit of cleanup const lBefore = data[key].length @@ -312,7 +315,18 @@ export default class EditLayerState extends EditJsonState { } this.configuration.addCallbackAndRunD((layer) => { - const changed = cleanArray(layer, "tagRenderings") || cleanArray(layer, "pointRenderings") + let changed = cleanArray(layer, "tagRenderings") || cleanArray(layer, "pointRenderings") + for (const tr of layer.tagRenderings ?? []) { + if(typeof tr === "string"){ + continue + } + + const qtr = ( tr) + if(qtr.freeform && Object.keys(qtr.freeform ).length === 0){ + delete qtr.freeform + changed = true + } + } if(changed){ this.configuration.ping() }