feat: show error toast if trying to download db on external db

This commit is contained in:
Jun Siang Cheah 2024-04-27 15:53:31 +01:00
parent e91a49c455
commit 47a33acfeb
4 changed files with 21 additions and 6 deletions

View file

@ -2,6 +2,7 @@
import { downloadDatabase } from '$lib/apis/utils';
import { onMount, getContext } from 'svelte';
import { config } from '$lib/stores';
import { toast } from 'svelte-sonner';
const i18n = getContext('i18n');
@ -32,7 +33,9 @@
on:click={() => {
// exportAllUserChats();
downloadDatabase(localStorage.token);
downloadDatabase(localStorage.token).catch((error) => {
toast.error(error);
});
}}
>
<div class=" self-center mr-3">