diff --git a/materialious/src/lib/components/Toast.svelte b/materialious/src/lib/components/Toast.svelte index c1c984a6..6350c609 100644 --- a/materialious/src/lib/components/Toast.svelte +++ b/materialious/src/lib/components/Toast.svelte @@ -11,7 +11,7 @@ action?: ToastAction; } - const toaster = new Toaster(); + export const toaster = new Toaster(); export const addToast = toaster.addToast; diff --git a/materialious/src/lib/components/settings/ExportImport.svelte b/materialious/src/lib/components/settings/ExportImport.svelte index cecd1121..3d9ed330 100644 --- a/materialious/src/lib/components/settings/ExportImport.svelte +++ b/materialious/src/lib/components/settings/ExportImport.svelte @@ -1,6 +1,7 @@
@@ -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" /> diff --git a/materialious/src/lib/i18n/locales/en.json b/materialious/src/lib/i18n/locales/en.json index 31715ece..c5589347 100644 --- a/materialious/src/lib/i18n/locales/en.json +++ b/materialious/src/lib/i18n/locales/en.json @@ -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",