From 01d9e5917513356c528fb55a063c40a081f1f664 Mon Sep 17 00:00:00 2001 From: Lyssieth Date: Sat, 6 Jan 2024 19:52:28 +0200 Subject: [PATCH] Fix a bunch of shit, hopefully --- src/App.svelte | 5 +++++ src/lib/Controls.svelte | 9 +++++++++ src/lib/Question.svelte | 28 ++++++++++++++++++++++------ src/lib/Questionnaire.svelte | 7 ++----- src/lib/Section.svelte | 13 +++++++++---- 5 files changed, 47 insertions(+), 15 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 048fd03..17969f1 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -39,6 +39,11 @@ >on one of these places I exist on.

+

+ Currently, entering Edit Mode forcibly refreshes the display without giving + a prompt to save first. Please be aware of this and don't edit a template + while filling it in. +


diff --git a/src/lib/Controls.svelte b/src/lib/Controls.svelte index 192f1b8..11b8f25 100644 --- a/src/lib/Controls.svelte +++ b/src/lib/Controls.svelte @@ -151,6 +151,15 @@ return template.name; } } + + editMode.subscribe((v) => { + if (v && $current) { + current.update((v) => v); // noop just to trigger the update + + if ($current.author instanceof Object) + $current.author = $current.author.name; // remove the link so nobody can claim it's an official template + } + });
diff --git a/src/lib/Question.svelte b/src/lib/Question.svelte index 9d9d6d0..3a4d574 100644 --- a/src/lib/Question.svelte +++ b/src/lib/Question.svelte @@ -1,16 +1,17 @@ -
  • +
  • {#if $editMode}

    Title

    @@ -66,7 +82,7 @@
    {:else}