Refactor globalApi.ts to import moduleUpdate function for saving database

This commit is contained in:
kwaroran
2024-10-26 21:22:07 +09:00
parent da907f4fc2
commit deb4f8d5d9
2 changed files with 3 additions and 1 deletions

View File

@@ -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){

View File

@@ -399,7 +399,7 @@ let lastGlobalEnabledModules: string[] = []
let lastChatEnabledModules: string[] = []
let characterHideIcon = false
function onModuleUpdate(){
export function moduleUpdate(){
if(!Array.isArray(lastGlobalEnabledModules)){
lastGlobalEnabledModules = []
}