Make analytics and error reporting optional

This commit is contained in:
Jon Staab
2025-03-03 15:09:58 -08:00
parent b399fa8dcc
commit ffb36af734
5 changed files with 69 additions and 10 deletions
+33 -3
View File
@@ -39,7 +39,7 @@
<form class="content column gap-4" {onsubmit}>
<div class="card2 bg-alt col-4 shadow-xl">
<p class="text-lg">Content Settings</p>
<strong class="text-lg">Content Settings</strong>
<FieldInline>
{#snippet label()}
<p>Hide sensitive content?</p>
@@ -77,7 +77,37 @@
</div>
{/snippet}
</Field>
<p class="text-lg">Editor Settings</p>
<strong class="text-lg">Privacy Settings</strong>
<FieldInline>
{#snippet label()}
<p>Report errors?</p>
{/snippet}
{#snippet input()}
<input
type="checkbox"
class="toggle toggle-primary"
bind:checked={settings.report_errors} />
{/snippet}
{#snippet info()}
<p>
Allow {PLATFORM_NAME} to send error reports to help improve the app.
</p>
{/snippet}
</FieldInline>
<FieldInline>
{#snippet label()}
<p>Report usage?</p>
{/snippet}
{#snippet input()}
<input type="checkbox" class="toggle toggle-primary" bind:checked={settings.report_usage} />
{/snippet}
{#snippet info()}
<p>
Allow {PLATFORM_NAME} to collect anonymous usage data.
</p>
{/snippet}
</FieldInline>
<strong class="text-lg">Editor Settings</strong>
<FieldInline>
{#snippet label()}
<p>Send Delay</p>
@@ -119,7 +149,7 @@
</div>
{/snippet}
{#snippet info()}
<p>Choose a media server type and url for files you upload to flotilla.</p>
<p>Choose a media server type and url for files you upload to {PLATFORM_NAME}.</p>
{/snippet}
</Field>
<div class="mt-4 flex flex-row items-center justify-between gap-4">
+22 -5
View File
@@ -3,6 +3,7 @@
import {hexToBytes} from "@noble/hashes/utils"
import {displayPubkey, displayProfile} from "@welshman/util"
import {pubkey, session, displayNip05, deriveProfile} from "@welshman/app"
import {slideAndFade} from "@lib/transition"
import Icon from "@lib/components/Icon.svelte"
import FieldInline from "@lib/components/FieldInline.svelte"
import Button from "@lib/components/Button.svelte"
@@ -29,6 +30,8 @@
const startEject = () => pushModal(InfoKeys)
const startDelete = () => pushModal(ProfileDelete)
let showAdvanced = false
</script>
<div class="content column gap-4">
@@ -122,10 +125,24 @@
{/if}
</div>
<Alerts />
<div class="card2 bg-alt col-4 shadow-xl">
<Button class="btn btn-outline btn-error" onclick={startDelete}>
<Icon icon="trash-bin-2" />
Delete your profile
</Button>
<div class="card2 bg-alt shadow-xl">
<div class="flex items-center justify-between">
<strong>Advanced</strong>
<Button onclick={() => (showAdvanced = !showAdvanced)}>
{#if showAdvanced}
<Icon icon="alt-arrow-down" />
{:else}
<Icon icon="alt-arrow-up" />
{/if}
</Button>
</div>
{#if showAdvanced}
<div transition:slideAndFade class="pt-4">
<Button class="btn btn-outline btn-error" onclick={startDelete}>
<Icon icon="trash-bin-2" />
Delete your profile
</Button>
</div>
{/if}
</div>
</div>