Adrien Denat coyotte508 HF staff commited on
Commit
865ebc3
โ€ข
1 Parent(s): 5b779a6

๐Ÿ› Fix settings modal not resetting its state (#240)

Browse files

* ๐Ÿ› Fix settings modal not resetting its state

should not mutate passed prop

* make variable dynamic in case it's updated from outside

Co-authored-by: Eliott C. <[email protected]>

* Revert "make variable dynamic in case it's updated from outside"

This reverts commit ba1938eaf92c91a42077e69a860f89ec1a8bd740.

---------

Co-authored-by: Eliott C. <[email protected]>

src/lib/components/SettingsModal.svelte CHANGED
@@ -10,6 +10,8 @@
10
 
11
  export let settings: Pick<Settings, "shareConversationsWithModelAuthors">;
12
 
 
 
13
  const dispatch = createEventDispatcher<{ close: void }>();
14
  </script>
15
 
@@ -35,7 +37,7 @@
35
  {/each}
36
  <Switch
37
  name="shareConversationsWithModelAuthors"
38
- bind:checked={settings.shareConversationsWithModelAuthors}
39
  />
40
  Share conversations with model authors
41
  </label>
 
10
 
11
  export let settings: Pick<Settings, "shareConversationsWithModelAuthors">;
12
 
13
+ let shareConversationsWithModelAuthors = settings.shareConversationsWithModelAuthors;
14
+
15
  const dispatch = createEventDispatcher<{ close: void }>();
16
  </script>
17
 
 
37
  {/each}
38
  <Switch
39
  name="shareConversationsWithModelAuthors"
40
+ bind:checked={shareConversationsWithModelAuthors}
41
  />
42
  Share conversations with model authors
43
  </label>