Added import toast

This commit is contained in:
WardPearce
2026-03-06 23:43:24 +13:00
parent 13b5d87c9d
commit f699d7c422
3 changed files with 21 additions and 2 deletions
+1 -1
View File
@@ -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"
/>
+3 -1
View 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",