feat: port config store to pinia

This commit is contained in:
Dominik Pschenitschni 2022-09-21 02:21:22 +02:00
parent 9e8c429864
commit a737fc5bc2
No known key found for this signature in database
GPG key ID: B257AC0149F43A77
21 changed files with 93 additions and 68 deletions

View file

@ -13,7 +13,6 @@ import {
MENU_ACTIVE,
QUICK_ACTIONS_ACTIVE,
} from './mutation-types'
import config from './modules/config'
import auth from './modules/auth'
import kanban from './modules/kanban'
import tasks from './modules/tasks'
@ -35,7 +34,6 @@ export function useStore () {
export const store = createStore<RootStoreState>({
strict: import.meta.env.DEV,
modules: {
config,
auth,
kanban,
tasks,

View file

@ -14,6 +14,7 @@ import type { RootStoreState, AuthState, Info} from '@/store/types'
import {AUTH_TYPES} from '@/store/types'
import type { IUserSettings } from '@/modelTypes/IUserSettings'
import router from '@/router'
import {useConfigStore} from '@/stores/config'
function defaultSettings(settings: Partial<IUserSettings>) {
if (typeof settings.weekStart === 'undefined' || settings.weekStart === '') {
@ -198,8 +199,8 @@ const authStore : Module<AuthState, RootStoreState> = {
}
},
redirectToProviderIfNothingElseIsEnabled({rootState}) {
const {auth} = rootState.config
redirectToProviderIfNothingElseIsEnabled() {
const {auth} = useConfigStore()
if (
auth.local.enabled === false &&
auth.openidConnect.enabled &&