feat: add confirmation alerts before loading account backup
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
import { hubURL } from "../characterCards"
|
import { hubURL } from "../characterCards"
|
||||||
import { getDatabase, setDatabase } from "../storage/database.svelte"
|
import { getDatabase, setDatabase } from "../storage/database.svelte"
|
||||||
import { alertError, alertMd, alertNormal, alertSelect, alertWait } from "../alert"
|
import { alertConfirm, alertError, alertMd, alertNormal, alertSelect, alertWait } from "../alert"
|
||||||
import { AppendableBuffer } from "../globalApi.svelte"
|
import { AppendableBuffer } from "../globalApi.svelte"
|
||||||
import { decodeRisuSave } from "../storage/risuSave"
|
import { decodeRisuSave } from "../storage/risuSave"
|
||||||
|
import { language } from "src/lang"
|
||||||
|
|
||||||
export async function risuLogin() {
|
export async function risuLogin() {
|
||||||
const win = window.open(hubURL + '/hub/login')
|
const win = window.open(hubURL + '/hub/login')
|
||||||
@@ -97,6 +98,13 @@ export async function loadRisuAccountBackup() {
|
|||||||
alertError("Invalid backup id")
|
alertError("Invalid backup id")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if(!await alertConfirm(language.backupLoadConfirm)){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(!await alertConfirm(language.backupLoadConfirm2)){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const backupId = backups[backupIdNum]
|
const backupId = backups[backupIdNum]
|
||||||
|
|
||||||
const backup = await fetch(hubURL + '/hub/backup/get', {
|
const backup = await fetch(hubURL + '/hub/backup/get', {
|
||||||
|
|||||||
Reference in New Issue
Block a user