Improve account and Add priority
This commit is contained in:
@@ -2,12 +2,14 @@ import { get, writable } from "svelte/store"
|
||||
import { DataBase } from "./database"
|
||||
import { hubURL } from "../characterCards"
|
||||
import localforage from "localforage"
|
||||
import { alertLogin, alertStore } from "../alert"
|
||||
import { alertError, alertLogin, alertStore, alertWait } from "../alert"
|
||||
import { forageStorage, getUnpargeables, replaceDbResources } from "./globalApi"
|
||||
import { encodeRisuSave } from "./risuSave"
|
||||
import { v4 } from "uuid"
|
||||
import { language } from "src/lang"
|
||||
|
||||
export const AccountWarning = writable('')
|
||||
const risuSession = Date.now().toFixed(0)
|
||||
|
||||
let seenWarnings:string[] = []
|
||||
|
||||
@@ -26,7 +28,8 @@ export class AccountStorage{
|
||||
'content-type': 'application/json',
|
||||
'x-risu-key': key,
|
||||
'x-risu-auth': this.auth,
|
||||
'X-Format': 'nocheck'
|
||||
'X-Format': 'nocheck',
|
||||
'x-risu-session': risuSession
|
||||
}
|
||||
})
|
||||
if(da.headers.get('Content-Type') === 'application/json'){
|
||||
@@ -37,6 +40,11 @@ export class AccountStorage{
|
||||
AccountWarning.set(json.warning)
|
||||
}
|
||||
}
|
||||
if(json?.reloadSession){
|
||||
alertWait(language.reloadSession)
|
||||
location.reload()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if(da.status === 304){
|
||||
|
||||
@@ -12,7 +12,7 @@ import { checkRisuUpdate } from "../update";
|
||||
import { MobileGUI, botMakerMode, selectedCharID } from "../stores";
|
||||
import { Body, ResponseType, fetch as TauriFetch } from "@tauri-apps/api/http";
|
||||
import { loadPlugins } from "../plugins/plugins";
|
||||
import { alertConfirm, alertError, alertNormal, alertNormalWait, alertSelect, alertTOS } from "../alert";
|
||||
import { alertConfirm, alertError, alertNormal, alertNormalWait, alertSelect, alertTOS, alertWait } from "../alert";
|
||||
import { checkDriverInit, syncDrive } from "../drive/drive";
|
||||
import { hasher } from "../parser";
|
||||
import { characterURLImport, hubURL } from "../characterCards";
|
||||
@@ -299,8 +299,8 @@ export async function saveDb(){
|
||||
}
|
||||
if(!gotChannel){
|
||||
gotChannel = true
|
||||
await alertNormalWait(language.activeTabChange)
|
||||
gotChannel = false
|
||||
alertWait(language.activeTabChange)
|
||||
location.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user