[fix] Fixed a bug where new users showed "Your save file is corrupted" due to a null exception

This commit is contained in:
ASDF9999
2023-06-26 00:41:32 +07:00
parent 85db744019
commit 41aba65c02

View File

@@ -310,7 +310,8 @@ export async function loadData() {
else{
let gotStorage:Uint8Array = await forageStorage.getItem('database/database.bin')
if(checkNullish(gotStorage)){
await forageStorage.setItem('database/database.bin', encodeRisuSave({}))
gotStorage = encodeRisuSave({})
await forageStorage.setItem('database/database.bin', gotStorage)
}
try {
setDatabase(