Add TOS alert

This commit is contained in:
kwaroran
2024-08-26 17:20:54 +09:00
parent b9721b80c5
commit f7ddc09277
3 changed files with 13 additions and 6 deletions

View File

@@ -246,7 +246,7 @@ export async function alertCardExport(type:string = ''){
export async function alertTOS(){
if(localStorage.getItem('tos') === 'true'){
if(localStorage.getItem('tos2') === 'true'){
return true
}
@@ -263,7 +263,7 @@ export async function alertTOS(){
}
if(get(alertStore).msg === 'yes'){
localStorage.setItem('tos', 'true')
localStorage.setItem('tos2', 'true')
return true
}

View File

@@ -12,7 +12,7 @@ import { checkRisuUpdate } from "../update";
import { 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 } from "../alert";
import { alertConfirm, alertError, alertNormal, alertNormalWait, alertSelect, alertTOS } from "../alert";
import { checkDriverInit, syncDrive } from "../drive/drive";
import { hasher } from "../parser";
import { characterURLImport, hubURL } from "../characterCards";
@@ -536,7 +536,14 @@ export async function loadData() {
loadedStore.set(true)
selectedCharID.set(-1)
startObserveDom()
saveDb()
saveDb()
if(import.meta.env.VITE_RISU_TOS === 'TRUE'){
alertTOS().then((a) => {
if(a === false){
location.reload()
}
})
}
} catch (error) {
alertError(`${error}`)
}