mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-26 23:50:52 +01:00
fix: remove asynchronous callback
This commit is contained in:
parent
aba4ddf2db
commit
1cae6718ea
27
src/App.tsx
27
src/App.tsx
@ -24,7 +24,7 @@ export const App: FC<{}> = props =>
|
|||||||
Nitro.bootstrap();
|
Nitro.bootstrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
const handler = useCallback(async (event: NitroEvent) =>
|
const handler = useCallback((event: NitroEvent) =>
|
||||||
{
|
{
|
||||||
switch(event.type)
|
switch(event.type)
|
||||||
{
|
{
|
||||||
@ -82,19 +82,20 @@ export const App: FC<{}> = props =>
|
|||||||
|
|
||||||
if(assetUrls && assetUrls.length) for(const url of assetUrls) urls.push(NitroConfiguration.interpolate(url));
|
if(assetUrls && assetUrls.length) for(const url of assetUrls) urls.push(NitroConfiguration.interpolate(url));
|
||||||
|
|
||||||
const status = await GetAssetManager().downloadAssets(urls);
|
GetAssetManager().downloadAssets(urls)
|
||||||
|
.then((status) => {
|
||||||
|
if(status)
|
||||||
|
{
|
||||||
|
GetCommunication().init();
|
||||||
|
|
||||||
if(status)
|
setPercent(prevValue => (prevValue + 20))
|
||||||
{
|
}
|
||||||
GetCommunication().init();
|
else
|
||||||
|
{
|
||||||
setPercent(prevValue => (prevValue + 20))
|
setIsError(true);
|
||||||
}
|
setMessage('Assets Failed');
|
||||||
else
|
}
|
||||||
{
|
})
|
||||||
setIsError(true);
|
|
||||||
setMessage('Assets Failed');
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user