nsarrazin HF staff commited on
Commit
ad481ce
1 Parent(s): 41f29a4

Conditionally show the data sharing toggle (#624)

Browse files
Files changed (1) hide show
  1. src/routes/settings/+page.svelte +16 -14
src/routes/settings/+page.svelte CHANGED
@@ -10,6 +10,7 @@
10
 
11
  import { useSettingsStore } from "$lib/stores/settings";
12
  import Switch from "$lib/components/Switch.svelte";
 
13
 
14
  let isConfirmingDeletion = false;
15
 
@@ -24,21 +25,22 @@
24
  </div>
25
 
26
  <div class="flex h-full flex-col gap-4 pt-4 max-sm:pt-0">
27
- <!-- svelte-ignore a11y-label-has-associated-control -->
28
- <label class="flex items-center">
29
- <Switch
30
- name="shareConversationsWithModelAuthors"
31
- bind:checked={$settings.shareConversationsWithModelAuthors}
32
- />
33
- <div class="inline cursor-pointer select-none items-center gap-2 pl-2">
34
- Share conversations with model authors
35
- </div>
36
- </label>
37
-
38
- <p class="text-sm text-gray-500">
39
- Sharing your data will help improve the training data and make open models better over time.
40
- </p>
41
 
 
 
 
 
42
  <!-- svelte-ignore a11y-label-has-associated-control -->
43
  <label class="mt-6 flex items-center">
44
  <Switch name="hideEmojiOnSidebar" bind:checked={$settings.hideEmojiOnSidebar} />
 
10
 
11
  import { useSettingsStore } from "$lib/stores/settings";
12
  import Switch from "$lib/components/Switch.svelte";
13
+ import { PUBLIC_APP_DATA_SHARING } from "$env/static/public";
14
 
15
  let isConfirmingDeletion = false;
16
 
 
25
  </div>
26
 
27
  <div class="flex h-full flex-col gap-4 pt-4 max-sm:pt-0">
28
+ {#if PUBLIC_APP_DATA_SHARING === "1"}
29
+ <!-- svelte-ignore a11y-label-has-associated-control -->
30
+ <label class="flex items-center">
31
+ <Switch
32
+ name="shareConversationsWithModelAuthors"
33
+ bind:checked={$settings.shareConversationsWithModelAuthors}
34
+ />
35
+ <div class="inline cursor-pointer select-none items-center gap-2 pl-2">
36
+ Share conversations with model authors
37
+ </div>
38
+ </label>
 
 
 
39
 
40
+ <p class="text-sm text-gray-500">
41
+ Sharing your data will help improve the training data and make open models better over time.
42
+ </p>
43
+ {/if}
44
  <!-- svelte-ignore a11y-label-has-associated-control -->
45
  <label class="mt-6 flex items-center">
46
  <Switch name="hideEmojiOnSidebar" bind:checked={$settings.hideEmojiOnSidebar} />