{
- defineRule(rule, AllRules[rule])
-})
-
import App from '@/App.vue'
import router from '@/router'
-
import 'unfonts.css'
import 'animate.css'
import '@assets/main.css'
import { cloneDeep } from 'lodash'
+Object.keys(AllRules).forEach(rule => {
+ defineRule(rule, AllRules[rule])
+})
+
const app = createApp(App)
const pinia = createPinia()
diff --git a/src/stores/useMemory.ts b/src/stores/useMemory.ts
index 015fbaf..e3b390d 100644
--- a/src/stores/useMemory.ts
+++ b/src/stores/useMemory.ts
@@ -9,7 +9,11 @@ export const useMemory = defineStore('memory', () => {
data: [],
})
- const { state: collections, isLoading, execute: fetchCollections } = useAsyncState(MemoryService.getCollections, undefined)
+ const {
+ state: collections,
+ isLoading,
+ execute: fetchCollections,
+ } = useAsyncState(MemoryService.getCollections, undefined, { resetOnExecute: false })
watchEffect(() => {
currentState.loading = isLoading.value
diff --git a/src/stores/useMessages.ts b/src/stores/useMessages.ts
index 1a8a00c..05365d7 100644
--- a/src/stores/useMessages.ts
+++ b/src/stores/useMessages.ts
@@ -36,7 +36,7 @@ export const useMessages = defineStore('messages', () => {
],
})
- const { state: history } = useAsyncState(MemoryService.getConversation, [])
+ const { state: history } = useAsyncState(MemoryService.getConversation, [], { resetOnExecute: false })
watchEffect(() => {
history.value.forEach(({ who, message, why, when }) => {
diff --git a/src/stores/usePlugins.ts b/src/stores/usePlugins.ts
index 78a8b20..c2f3a39 100644
--- a/src/stores/usePlugins.ts
+++ b/src/stores/usePlugins.ts
@@ -13,8 +13,8 @@ export const usePlugins = defineStore('plugins', () => {
},
})
- const { state: plugins, isLoading, execute: fetchPlugins } = useAsyncState(PluginService.getPlugins, undefined)
- const { state: settings, execute: fetchSettings } = useAsyncState(PluginService.getPluginsSettings, undefined)
+ const { state: plugins, isLoading, execute: fetchPlugins } = useAsyncState(PluginService.getPlugins, undefined, { resetOnExecute: false })
+ const { state: settings, execute: fetchSettings } = useAsyncState(PluginService.getPluginsSettings, undefined, { resetOnExecute: false })
const { showNotification, sendNotificationFromJSON } = useNotifications()
diff --git a/src/stores/useSettings.ts b/src/stores/useSettings.ts
index 615a740..a6e8e93 100644
--- a/src/stores/useSettings.ts
+++ b/src/stores/useSettings.ts
@@ -1,7 +1,6 @@
-import { apiClient, tryRequest } from '@/api'
import { useJwt } from '@vueuse/integrations/useJwt'
import { useCookies } from '@vueuse/integrations/useCookies'
-import type { Status, AuthPermission, AuthResource } from 'ccat-api'
+import type { AuthPermission, AuthResource } from 'ccat-api'
import type { JwtPayload } from 'jwt-decode'
interface Filter {
@@ -49,22 +48,12 @@ export const useSettings = defineStore('settings', () => {
},
})
- const getStatus = async () => {
- const result = await tryRequest(apiClient.api?.status.home(), 'Getting Cheshire Cat status', 'Unable to fetch Cheshire Cat status')
- return result.data ?? result.message
- }
-
- const { state: cat, execute } = useAsyncState(getStatus, {} as Status)
-
return {
isDark,
pluginsFilters,
toggleDark,
- cat,
cookie,
jwt,
- getStatus,
- refreshStatus: execute,
}
})
diff --git a/src/views/SettingsView.vue b/src/views/SettingsView.vue
index 2488720..67226bc 100644
--- a/src/views/SettingsView.vue
+++ b/src/views/SettingsView.vue
@@ -1,8 +1,14 @@