diff --git a/src/store/chat/persist.ts b/src/store/chat/persist.ts new file mode 100644 index 0000000..8684893 --- /dev/null +++ b/src/store/chat/persist.ts @@ -0,0 +1 @@ +export default ['chat.applications', 'chat.conversations']; diff --git a/src/store/common/persist.ts b/src/store/common/persist.ts new file mode 100644 index 0000000..780c607 --- /dev/null +++ b/src/store/common/persist.ts @@ -0,0 +1 @@ +export default ['user', 'token', 'setting']; diff --git a/src/store/index.ts b/src/store/index.ts index f05e9e2..3a41d69 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,8 +1,11 @@ -import { createStore, ActionContext } from 'vuex'; +import { createStore } from 'vuex'; import createPersistedState from 'vuex-persistedstate'; import midjourney from './midjourney'; import chat from './chat'; import root from './common'; +import persistChat from './chat/persist'; +import persistMidjourney from './midjourney/persist'; +import persistRoot from './common/persist'; const store = createStore({ ...root, @@ -12,16 +15,7 @@ const store = createStore({ }, plugins: [ createPersistedState({ - paths: [ - 'token', - 'user', - 'chat.applications', - 'chat.conversations', - 'midjourney.preset', - 'midjourney.channel', - 'midjourney.applications', - 'midjourney.imagineTasks' - ] + paths: [...persistRoot, ...persistChat, ...persistMidjourney] }) ] }); diff --git a/src/store/midjourney/persist.ts b/src/store/midjourney/persist.ts new file mode 100644 index 0000000..cc81185 --- /dev/null +++ b/src/store/midjourney/persist.ts @@ -0,0 +1 @@ +export default ['midjourney.preset', 'midjourney.channel', 'midjourney.applications', 'midjourney.imagineTasks'];