diff --git a/apps/svelte.dev/src/lib/icons/download-dark.svg b/apps/svelte.dev/src/lib/icons/download-dark.svg new file mode 100644 index 0000000000..b769ca5914 --- /dev/null +++ b/apps/svelte.dev/src/lib/icons/download-dark.svg @@ -0,0 +1 @@ + diff --git a/apps/svelte.dev/src/lib/icons/download-light.svg b/apps/svelte.dev/src/lib/icons/download-light.svg new file mode 100644 index 0000000000..a1f28e2b87 --- /dev/null +++ b/apps/svelte.dev/src/lib/icons/download-light.svg @@ -0,0 +1 @@ + diff --git a/apps/svelte.dev/src/lib/icons/user-dark.svg b/apps/svelte.dev/src/lib/icons/user-dark.svg new file mode 100644 index 0000000000..91402ad157 --- /dev/null +++ b/apps/svelte.dev/src/lib/icons/user-dark.svg @@ -0,0 +1 @@ + diff --git a/apps/svelte.dev/src/lib/icons/user-light.svg b/apps/svelte.dev/src/lib/icons/user-light.svg new file mode 100644 index 0000000000..05e1cd22cf --- /dev/null +++ b/apps/svelte.dev/src/lib/icons/user-light.svg @@ -0,0 +1 @@ + diff --git a/apps/svelte.dev/src/routes/(authed)/playground/[id]/+page.svelte b/apps/svelte.dev/src/routes/(authed)/playground/[id]/+page.svelte index 2028702f46..f976ff6677 100644 --- a/apps/svelte.dev/src/routes/(authed)/playground/[id]/+page.svelte +++ b/apps/svelte.dev/src/routes/(authed)/playground/[id]/+page.svelte @@ -14,8 +14,7 @@ let repl = $state() as Repl; let name = $state(data.gist.name); - let zen_mode = $state(false); - let modified_count = $state(0); + let modified = $state(false); let version = data.version; let setting_hash: any = null; @@ -51,7 +50,7 @@ if (!hash) { repl?.set({ - files: data.gist.components + files: structuredClone(data.gist.components) }); return; @@ -91,12 +90,12 @@ } function handle_change({ files }: { files: File[] }) { - const old_count = modified_count; - modified_count = files.filter((c) => c.modified).length; + const was_modified = modified; + modified = files.some((c) => c.modified); if ( - old_count === 0 && - modified_count > 0 && + !was_modified && + modified && name === data.gist.name && data.examples.some((section) => section.examples.some((example) => example.slug === data.gist.id) @@ -130,7 +129,7 @@ }} /> -