mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-04-15 01:41:56 +00:00
20 lines
488 B
TypeScript
20 lines
488 B
TypeScript
import { useStorage } from '@vueuse/core';
|
|
import { computed } from 'vue';
|
|
|
|
interface UserConfig {
|
|
isPipelineFeedOpen: boolean;
|
|
redirectUrl: string;
|
|
}
|
|
|
|
const config = useStorage<UserConfig>('woodpecker:user-config', {
|
|
isPipelineFeedOpen: false,
|
|
redirectUrl: '',
|
|
});
|
|
|
|
export default () => ({
|
|
setUserConfig<T extends keyof UserConfig>(key: T, value: UserConfig[T]): void {
|
|
config.value = { ...config.value, [key]: value };
|
|
},
|
|
userConfig: computed(() => config.value),
|
|
});
|