fix genCoroutine

This commit is contained in:
Rintim 2023-09-06 19:18:13 +08:00
parent 86fb67a4b5
commit 6ece9e91f7
1 changed files with 6 additions and 6 deletions

View File

@ -7159,8 +7159,8 @@
genAsync:fn=>gnc.async(fn), genAsync:fn=>gnc.async(fn),
genAwait:gen=>gnc.await(gen), genAwait:gen=>gnc.await(gen),
gnc:{ gnc:{
async:gnc.async(fn), async:fn=>gnc.async(fn),
await:gnc.await(gen), await:gen=>gnc.await(gen),
is:{ is:{
coroutine:item=>gnc.is.coroutine(item), coroutine:item=>gnc.is.coroutine(item),
generatorFunc:item=>gnc.is.generatorFunc(item), generatorFunc:item=>gnc.is.generatorFunc(item),
@ -9564,7 +9564,7 @@
} }
game.loop(); game.loop();
}) })
var proceed=function(){ var proceed=gnc.async(function*(){
if(!lib.db){ if(!lib.db){
try{ try{
lib.storage=JSON.parse(localStorage.getItem(lib.configprefix+lib.config.mode)); lib.storage=JSON.parse(localStorage.getItem(lib.configprefix+lib.config.mode));
@ -9575,7 +9575,7 @@
lib.storage={}; lib.storage={};
localStorage.setItem(lib.configprefix+lib.config.mode,"{}"); localStorage.setItem(lib.configprefix+lib.config.mode,"{}");
} }
proceed2(); yield proceed2();
} }
else{ else{
game.getDB('data',lib.config.mode,function(obj){ game.getDB('data',lib.config.mode,function(obj){
@ -9583,7 +9583,7 @@
proceed2(); proceed2();
}); });
} }
}; });
if(!lib.imported.mode||!lib.imported.mode[lib.config.mode]){ if(!lib.imported.mode||!lib.imported.mode[lib.config.mode]){
window.inSplash=true; window.inSplash=true;
clearTimeout(window.resetGameTimeout); clearTimeout(window.resetGameTimeout);
@ -9670,7 +9670,7 @@
} }
} }
else{ else{
proceed(); yield proceed();
} }
localStorage.removeItem(lib.configprefix+'directstart'); localStorage.removeItem(lib.configprefix+'directstart');
delete lib.init.init; delete lib.init.init;