[feat] added license
This commit is contained in:
@@ -3,7 +3,7 @@ import { sleep } from "./util"
|
||||
import { language } from "../lang"
|
||||
|
||||
interface alertData{
|
||||
type: 'error'| 'normal'|'none'|'ask'|'wait'|'selectChar'|'input'|'toast'|'wait2'|'markdown'|'select'|'login'
|
||||
type: 'error'| 'normal'|'none'|'ask'|'wait'|'selectChar'|'input'|'toast'|'wait2'|'markdown'|'select'|'login'|'tos'
|
||||
msg: string
|
||||
}
|
||||
|
||||
@@ -78,6 +78,15 @@ export function alertToast(msg:string){
|
||||
})
|
||||
}
|
||||
|
||||
export function alertWait(msg:string){
|
||||
|
||||
alertStore.set({
|
||||
'type': 'wait',
|
||||
'msg': msg
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
export async function alertSelectChar(){
|
||||
alertStore.set({
|
||||
'type': 'selectChar',
|
||||
@@ -111,6 +120,32 @@ export async function alertConfirm(msg:string){
|
||||
return get(alertStore).msg === 'yes'
|
||||
}
|
||||
|
||||
export async function alertTOS(){
|
||||
|
||||
// if(localStorage.getItem('tos') === 'true'){
|
||||
// return true
|
||||
// }
|
||||
|
||||
alertStore.set({
|
||||
'type': 'tos',
|
||||
'msg': 'tos'
|
||||
})
|
||||
|
||||
while(true){
|
||||
if (get(alertStore).type === 'none'){
|
||||
break
|
||||
}
|
||||
await sleep(10)
|
||||
}
|
||||
|
||||
if(get(alertStore).msg === 'yes'){
|
||||
localStorage.setItem('tos', 'true')
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
export async function alertInput(msg:string){
|
||||
|
||||
alertStore.set({
|
||||
|
||||
Reference in New Issue
Block a user