Skip to content

Commit

Permalink
allow subscribers to reset local data
Browse files Browse the repository at this point in the history
  • Loading branch information
a-type committed May 22, 2024
1 parent 742dd2c commit a981a80
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion packages/client/src/components/storage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,28 @@ export function ManageStorage({ className, onError }: ManageStorageProps) {

// sync users cannot manage local storage, it would cause unexpected
// results...
if (isSubscribed) return null;
if (isSubscribed) {
return (
<div className={clsx('flex flex-col items-start gap-2', className)}>
<H2>Manage Device Storage</H2>
<P className="text-xs mb-2">
Your data is synced to Biscuits. If you're experiencing issues, you
can try resetting your local device to the server's data.
</P>
<div className="flex flex-row gap-2 flex-wrap">
<ConfirmedButton
color="destructive"
confirmText="This will delete your local data and replace it with the server's data. It cannot be undone."
onConfirm={() => {
clientDesc?.__dangerous__resetLocal();
}}
>
Reset local data
</ConfirmedButton>
</div>
</div>
);
}

return (
<div className={clsx('flex flex-col items-start gap-2', className)}>
Expand Down

0 comments on commit a981a80

Please sign in to comment.