Skip to content

Commit ad481ce

Browse files
authored
Conditionally show the data sharing toggle (#624)
Closes #622
1 parent 41f29a4 commit ad481ce

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/routes/settings/+page.svelte

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
import { useSettingsStore } from "$lib/stores/settings";
1212
import Switch from "$lib/components/Switch.svelte";
13+
import { PUBLIC_APP_DATA_SHARING } from "$env/static/public";
1314
1415
let isConfirmingDeletion = false;
1516
@@ -24,21 +25,22 @@
2425
</div>
2526

2627
<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>
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>
4139

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}
4244
<!-- svelte-ignore a11y-label-has-associated-control -->
4345
<label class="mt-6 flex items-center">
4446
<Switch name="hideEmojiOnSidebar" bind:checked={$settings.hideEmojiOnSidebar} />

0 commit comments

Comments
 (0)