From deb4f8d5d9659acb55057ab4793c67fac59626cd Mon Sep 17 00:00:00 2001 From: kwaroran Date: Sat, 26 Oct 2024 21:22:07 +0900 Subject: [PATCH] Refactor globalApi.ts to import moduleUpdate function for saving database --- src/ts/globalApi.ts | 2 ++ src/ts/process/modules.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ts/globalApi.ts b/src/ts/globalApi.ts index 1328cb43..7613ecd5 100644 --- a/src/ts/globalApi.ts +++ b/src/ts/globalApi.ts @@ -41,6 +41,7 @@ import { encodeCapKeySafe } from "./storage/mobileStorage"; import { updateLorebooks } from "./characters"; import { initMobileGesture } from "./hotkey"; import { fetch as TauriHTTPFetch } from '@tauri-apps/plugin-http'; +import { moduleUpdate } from "./process/modules"; //@ts-ignore export const isTauri = !!window.__TAURI_INTERNALS__ @@ -589,6 +590,7 @@ export async function loadData() { selectedCharID.set(-1) startObserveDom() saveDb() + moduleUpdate() if(import.meta.env.VITE_RISU_TOS === 'TRUE'){ alertTOS().then((a) => { if(a === false){ diff --git a/src/ts/process/modules.ts b/src/ts/process/modules.ts index c35fd8cf..c4236654 100644 --- a/src/ts/process/modules.ts +++ b/src/ts/process/modules.ts @@ -399,7 +399,7 @@ let lastGlobalEnabledModules: string[] = [] let lastChatEnabledModules: string[] = [] let characterHideIcon = false -function onModuleUpdate(){ +export function moduleUpdate(){ if(!Array.isArray(lastGlobalEnabledModules)){ lastGlobalEnabledModules = [] }