Refactor globalApi.ts to import moduleUpdate function for saving database
This commit is contained in:
@@ -41,6 +41,7 @@ import { encodeCapKeySafe } from "./storage/mobileStorage";
|
|||||||
import { updateLorebooks } from "./characters";
|
import { updateLorebooks } from "./characters";
|
||||||
import { initMobileGesture } from "./hotkey";
|
import { initMobileGesture } from "./hotkey";
|
||||||
import { fetch as TauriHTTPFetch } from '@tauri-apps/plugin-http';
|
import { fetch as TauriHTTPFetch } from '@tauri-apps/plugin-http';
|
||||||
|
import { moduleUpdate } from "./process/modules";
|
||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
export const isTauri = !!window.__TAURI_INTERNALS__
|
export const isTauri = !!window.__TAURI_INTERNALS__
|
||||||
@@ -589,6 +590,7 @@ export async function loadData() {
|
|||||||
selectedCharID.set(-1)
|
selectedCharID.set(-1)
|
||||||
startObserveDom()
|
startObserveDom()
|
||||||
saveDb()
|
saveDb()
|
||||||
|
moduleUpdate()
|
||||||
if(import.meta.env.VITE_RISU_TOS === 'TRUE'){
|
if(import.meta.env.VITE_RISU_TOS === 'TRUE'){
|
||||||
alertTOS().then((a) => {
|
alertTOS().then((a) => {
|
||||||
if(a === false){
|
if(a === false){
|
||||||
|
|||||||
@@ -399,7 +399,7 @@ let lastGlobalEnabledModules: string[] = []
|
|||||||
let lastChatEnabledModules: string[] = []
|
let lastChatEnabledModules: string[] = []
|
||||||
let characterHideIcon = false
|
let characterHideIcon = false
|
||||||
|
|
||||||
function onModuleUpdate(){
|
export function moduleUpdate(){
|
||||||
if(!Array.isArray(lastGlobalEnabledModules)){
|
if(!Array.isArray(lastGlobalEnabledModules)){
|
||||||
lastGlobalEnabledModules = []
|
lastGlobalEnabledModules = []
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user