From fd663b9c0e0ed43a47c3c4b6db5c53e121c0bd1e Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Sun, 18 May 2025 18:14:06 -0700 Subject: [PATCH] feat: adds option to instantly redirect to new container (#3897) --- assets/components/common/DropdownMenu.vue | 2 +- assets/components/common/LabeledInput.vue | 2 +- assets/pages/container/[id].vue | 13 ++++++++++++- assets/pages/settings.vue | 19 +++++++++++++++++-- assets/stores/settings.ts | 12 ++++++++++-- internal/profile/disk.go | 2 +- 6 files changed, 42 insertions(+), 8 deletions(-) diff --git a/assets/components/common/DropdownMenu.vue b/assets/components/common/DropdownMenu.vue index 11ecb1da..fa943f14 100644 --- a/assets/components/common/DropdownMenu.vue +++ b/assets/components/common/DropdownMenu.vue @@ -1,5 +1,5 @@ diff --git a/assets/stores/settings.ts b/assets/stores/settings.ts index 8ef9abdf..48834182 100644 --- a/assets/stores/settings.ts +++ b/assets/stores/settings.ts @@ -14,7 +14,7 @@ export type Settings = { dateLocale: "auto" | "en-US" | "en-GB" | "de-DE" | "en-CA"; softWrap: boolean; collapseNav: boolean; - automaticRedirect: boolean; + automaticRedirect: "instant" | "delayed" | "none"; locale: string; }; export const DEFAULT_SETTINGS: Settings = { @@ -31,12 +31,20 @@ export const DEFAULT_SETTINGS: Settings = { dateLocale: "auto", softWrap: true, collapseNav: false, - automaticRedirect: true, + automaticRedirect: "delayed", locale: "", }; export const settings = useProfileStorage("settings", DEFAULT_SETTINGS); +// @ts-ignore: automaticRedirect is now a string enum, but might be a boolean in older data +if (settings.value.automaticRedirect === true) { + settings.value.automaticRedirect = "delayed"; + // @ts-ignore: automaticRedirect is now a string enum, but might be a boolean in older data +} else if (settings.value.automaticRedirect === false) { + settings.value.automaticRedirect = "none"; +} + export const { collapseNav, compact, diff --git a/internal/profile/disk.go b/internal/profile/disk.go index de5e2845..a8520dbb 100644 --- a/internal/profile/disk.go +++ b/internal/profile/disk.go @@ -28,7 +28,7 @@ type Settings struct { ShowAllContainers bool `json:"showAllContainers"` SoftWrap bool `json:"softWrap"` CollapseNav bool `json:"collapseNav"` - AutomaticRedirect bool `json:"automaticRedirect"` + AutomaticRedirect string `json:"automaticRedirect"` Size string `json:"size,omitempty"` Compact bool `json:"compact"` LightTheme string `json:"lightTheme,omitempty"`