Added import toast
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
action?: ToastAction;
|
||||
}
|
||||
|
||||
const toaster = new Toaster<ToastData>();
|
||||
export const toaster = new Toaster<ToastData>();
|
||||
|
||||
export const addToast = toaster.addToast;
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { _ } from '$lib/i18n';
|
||||
import { importSubscriptionsFromFile } from '$lib/importExport';
|
||||
import { addToast, toaster } from '../Toast.svelte';
|
||||
</script>
|
||||
|
||||
<div>
|
||||
@@ -13,7 +14,23 @@
|
||||
const files = (event.target as HTMLInputElement).files;
|
||||
if (files?.length === 0 || !files) return;
|
||||
|
||||
addToast({
|
||||
data: {
|
||||
text: $_('layout.export.importing')
|
||||
},
|
||||
id: 'importing-toast',
|
||||
closeDelay: 0
|
||||
});
|
||||
|
||||
await importSubscriptionsFromFile(files[0]);
|
||||
|
||||
toaster.removeToast('importing-toast');
|
||||
|
||||
addToast({
|
||||
data: {
|
||||
text: $_('layout.export.importingCompleted')
|
||||
}
|
||||
});
|
||||
}}
|
||||
type="file"
|
||||
/>
|
||||
|
||||
@@ -274,7 +274,9 @@
|
||||
"export": {
|
||||
"title": "Export/Import",
|
||||
"importSub": "Import subscriptions",
|
||||
"importSubSupported": "YouTube CSV/OPML, Invidious OPML/JSON, Freetube database & NewPipe JSON supported"
|
||||
"importSubSupported": "YouTube CSV/OPML, Invidious OPML/JSON, Freetube database & NewPipe JSON supported",
|
||||
"importing": "Importing subscriptions (this will take a moment)",
|
||||
"importingCompleted": "Subscriptions successfully imported"
|
||||
},
|
||||
"deArrow": {
|
||||
"title": "DeArrow",
|
||||
|
||||
Reference in New Issue
Block a user