[fix] Fixed a bug where new users showed "Your save file is corrupted" due to a null exception
This commit is contained in:
@@ -310,7 +310,8 @@ export async function loadData() {
|
|||||||
else{
|
else{
|
||||||
let gotStorage:Uint8Array = await forageStorage.getItem('database/database.bin')
|
let gotStorage:Uint8Array = await forageStorage.getItem('database/database.bin')
|
||||||
if(checkNullish(gotStorage)){
|
if(checkNullish(gotStorage)){
|
||||||
await forageStorage.setItem('database/database.bin', encodeRisuSave({}))
|
gotStorage = encodeRisuSave({})
|
||||||
|
await forageStorage.setItem('database/database.bin', gotStorage)
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
setDatabase(
|
setDatabase(
|
||||||
|
|||||||
Reference in New Issue
Block a user