web/Omnibox: remember the link input when switching between tabs

This commit is contained in:
wukko 2024-07-22 09:55:04 +06:00
parent 787fe72340
commit 24b783e5fb
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2
2 changed files with 17 additions and 0 deletions

View file

@ -7,7 +7,9 @@
import dialogs from "$lib/dialogs"; import dialogs from "$lib/dialogs";
import { storedLink } from "$lib/state/omnibox";
import { updateSetting } from "$lib/state/settings"; import { updateSetting } from "$lib/state/settings";
import type { DownloadModeOption } from "$lib/types/settings"; import type { DownloadModeOption } from "$lib/types/settings";
import type { Optional } from "$lib/types/generic"; import type { Optional } from "$lib/types/generic";
@ -29,6 +31,18 @@
let linkInput: Optional<HTMLInputElement>; let linkInput: Optional<HTMLInputElement>;
let isFocused = false; let isFocused = false;
let stored;
$: storedLink.set(link);
storedLink.subscribe((value) => {
stored = value;
});
if (!link && stored) {
link = stored
}
let isDisabled: boolean = false; let isDisabled: boolean = false;
let downloadButton: SvelteComponent; let downloadButton: SvelteComponent;

View file

@ -0,0 +1,3 @@
import { writable } from "svelte/store";
export const storedLink = writable();