diff --git a/web/src/components/save/Omnibox.svelte b/web/src/components/save/Omnibox.svelte index 1057d0c5..c032e6a8 100644 --- a/web/src/components/save/Omnibox.svelte +++ b/web/src/components/save/Omnibox.svelte @@ -7,7 +7,9 @@ import dialogs from "$lib/dialogs"; + import { storedLink } from "$lib/state/omnibox"; import { updateSetting } from "$lib/state/settings"; + import type { DownloadModeOption } from "$lib/types/settings"; import type { Optional } from "$lib/types/generic"; @@ -29,6 +31,18 @@ let linkInput: Optional; let isFocused = false; + let stored; + + $: storedLink.set(link); + + storedLink.subscribe((value) => { + stored = value; + }); + + if (!link && stored) { + link = stored + } + let isDisabled: boolean = false; let downloadButton: SvelteComponent; diff --git a/web/src/lib/state/omnibox.ts b/web/src/lib/state/omnibox.ts new file mode 100644 index 00000000..a882abce --- /dev/null +++ b/web/src/lib/state/omnibox.ts @@ -0,0 +1,3 @@ +import { writable } from "svelte/store"; + +export const storedLink = writable();