Skip to content

Commit cf72cbe

Browse files
committed
feat: dismiss sync alert
1 parent 256b66a commit cf72cbe

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

src/lib/stores/db.svelte.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export interface Snippet {
2323
export interface Database {
2424
settings: {
2525
languages: Language[];
26+
dismissedSyncWarning?: boolean;
2627
};
2728
categories: Category[];
2829
snippets: Snippet[];

src/routes/+page.svelte

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
<title>Copypasta - Home</title>
198198
</svelte:head>
199199

200-
{#if !authStore.isValid}
200+
{#if !authStore.isValid && !dbStore.data.settings.dismissedSyncWarning}
201201
<div class="mb-6 alert alert-warning">
202202
<AlertTriangle class="h-5 w-5" />
203203
<div>
@@ -207,7 +207,19 @@
207207
settings.
208208
</div>
209209
</div>
210-
<a href="{base}/settings" class="btn btn-sm">Configure Sync</a>
210+
<div class="flex items-center gap-2">
211+
<a href="{base}/settings" class="btn btn-sm">Configure Sync</a>
212+
<button
213+
class="btn btn-sm btn-square"
214+
onclick={() => {
215+
dbStore.data.settings.dismissedSyncWarning = true;
216+
dbStore.save();
217+
}}
218+
aria-label="Dismiss"
219+
>
220+
<X class="h-4 w-4" />
221+
</button>
222+
</div>
211223
</div>
212224
{/if}
213225

0 commit comments

Comments
 (0)