feat: port config store to pinia
This commit is contained in:
parent
9e8c429864
commit
a737fc5bc2
21 changed files with 93 additions and 68 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 &&
|
||||
|
|
|
|||
Reference in a new issue