From 27c1b29eb64ec8f54f6d9254d5c2ed247ba29fe9 Mon Sep 17 00:00:00 2001 From: Anbraten Date: Sun, 8 Oct 2023 20:40:35 +0200 Subject: [PATCH] use useStorage and same prefix --- .../components/repo/pipeline/PipelineLog.vue | 2 +- web/src/components/repo/settings/BadgeTab.vue | 2 +- web/src/components/user/UserGeneralTab.vue | 4 +-- web/src/compositions/useDarkMode.ts | 28 +++++++++++++++++++ web/src/compositions/useUserConfig.ts | 21 +++----------- web/src/utils/locale.ts | 4 +-- 6 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 web/src/compositions/useDarkMode.ts diff --git a/web/src/components/repo/pipeline/PipelineLog.vue b/web/src/components/repo/pipeline/PipelineLog.vue index 5fa128cb6..124d7ada3 100644 --- a/web/src/components/repo/pipeline/PipelineLog.vue +++ b/web/src/components/repo/pipeline/PipelineLog.vue @@ -163,7 +163,7 @@ const hasLogs = computed( // we do not have logs for skipped steps repo?.value && pipeline.value && step.value && step.value.state !== 'skipped', ); -const autoScroll = useStorage('log-auto-scroll', false); +const autoScroll = useStorage('woodpecker:log-auto-scroll', false); const showActions = ref(false); const downloadInProgress = ref(false); const ansiUp = ref(new AnsiUp()); diff --git a/web/src/components/repo/settings/BadgeTab.vue b/web/src/components/repo/settings/BadgeTab.vue index 0ace5d1bb..b7171a66c 100644 --- a/web/src/components/repo/settings/BadgeTab.vue +++ b/web/src/components/repo/settings/BadgeTab.vue @@ -55,7 +55,7 @@ import type { Repo } from '~/lib/api/types'; const apiClient = useApiClient(); const repo = inject>('repo'); -const badgeType = useStorage('last-badge-type', 'markdown'); +const badgeType = useStorage('woodpecker:last-badge-type', 'markdown'); if (!repo) { throw new Error('Unexpected: "repo" should be provided at this place'); diff --git a/web/src/components/user/UserGeneralTab.vue b/web/src/components/user/UserGeneralTab.vue index fea7cc833..f46dc44d6 100644 --- a/web/src/components/user/UserGeneralTab.vue +++ b/web/src/components/user/UserGeneralTab.vue @@ -18,7 +18,7 @@