mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-29 11:06:10 +00:00
web/Omnibox: remember the link input when switching between tabs
This commit is contained in:
parent
787fe72340
commit
24b783e5fb
|
@ -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<HTMLInputElement>;
|
||||
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;
|
||||
|
|
3
web/src/lib/state/omnibox.ts
Normal file
3
web/src/lib/state/omnibox.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { writable } from "svelte/store";
|
||||
|
||||
export const storedLink = writable();
|
Loading…
Reference in a new issue