diff --git a/web/i18n/en/button.json b/web/i18n/en/button.json index e75ac3d1..f387e7d4 100644 --- a/web/i18n/en/button.json +++ b/web/i18n/en/button.json @@ -19,5 +19,7 @@ "no": "no", "clear": "clear", "show_input": "show input", - "hide_input": "hide input" + "hide_input": "hide input", + "restore_input": "restore input", + "clear_input": "clear input" } diff --git a/web/src/components/settings/SettingsInput.svelte b/web/src/components/settings/SettingsInput.svelte index 9bf90a47..267d4cf1 100644 --- a/web/src/components/settings/SettingsInput.svelte +++ b/web/src/components/settings/SettingsInput.svelte @@ -14,10 +14,13 @@ import IconX from "@tabler/icons-svelte/IconX.svelte"; import IconCheck from "@tabler/icons-svelte/IconCheck.svelte"; + import IconArrowBack from "@tabler/icons-svelte/IconArrowBack.svelte"; import IconEye from "@tabler/icons-svelte/IconEye.svelte"; import IconEyeClosed from "@tabler/icons-svelte/IconEyeClosed.svelte"; + type SettingsInputType = "url" | "uuid"; + export let settingId: Id; export let settingContext: Context; export let placeholder: string; @@ -41,7 +44,11 @@ $: inputType = sensitive && inputHidden ? "password" : "text"; - const writeToSettings = (value: string, type: "url" | "uuid" | "text") => { + const checkInput = () => { + validInput = input.checkValidity() || inputValue === ""; + } + + const writeToSettings = (value: string, type: SettingsInputType) => { updateSetting({ [settingContext]: { [settingId]: @@ -55,8 +62,9 @@ if (showInstanceWarning) { await customInstanceWarning(); - if ($settings.processing.seenCustomWarning && inputValue) { - return writeToSettings(inputValue, type); + if ($settings.processing.seenCustomWarning) { + // allow writing empty strings + return writeToSettings(inputValue, inputValue ? type : "uuid"); } return; @@ -70,7 +78,6 @@