Add TOS alert
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user