diff --git a/package.json b/package.json index 44de2d79..97b5220a 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "@fortawesome/fontawesome-svg-core": "^6.1.1", "@fortawesome/free-solid-svg-icons": "^6.1.1", "@fortawesome/react-fontawesome": "^0.2.0", - "@nitrots/nitro-renderer": "^1.4.7", + "@nitrots/nitro-renderer": "^1.4.8", "@tanstack/react-virtual": "^3.0.0-beta.18", "animate.css": "^4.1.1", "cross-env": "^7.0.3", diff --git a/src/App.tsx b/src/App.tsx index f5a8b3f7..bba59ba7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -24,7 +24,7 @@ export const App: FC<{}> = props => Nitro.bootstrap(); } - const handler = useCallback((event: NitroEvent) => + const handler = useCallback(async (event: NitroEvent) => { switch(event.type) { @@ -82,20 +82,19 @@ export const App: FC<{}> = props => if(assetUrls && assetUrls.length) for(const url of assetUrls) urls.push(NitroConfiguration.interpolate(url)); - GetAssetManager().downloadAssets(urls, (status: boolean) => + const status = await GetAssetManager().downloadAssets(urls); + + if(status) { - if(status) - { - GetCommunication().init(); + GetCommunication().init(); - setPercent(prevValue => (prevValue + 20)) - } - else - { - setIsError(true); - setMessage('Assets Failed'); - } - }); + setPercent(prevValue => (prevValue + 20)) + } + else + { + setIsError(true); + setMessage('Assets Failed'); + } return; } } diff --git a/yarn.lock b/yarn.lock index 7043ef66..2868ec81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1484,10 +1484,10 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@nitrots/nitro-renderer@^1.4.7": - version "1.4.7" - resolved "https://registry.yarnpkg.com/@nitrots/nitro-renderer/-/nitro-renderer-1.4.7.tgz#1332c90bebe1d83827f7a7d57dc23f08a29ac004" - integrity sha512-704o6DDxhb3ug+zsBBmwdaATI/lhGNu/xMtdepMEZrPBkP/cFu0s5ofEsL1rkRJ0M6ceuTt+lCUsKgUXHxGWgg== +"@nitrots/nitro-renderer@^1.4.8": + version "1.4.8" + resolved "https://registry.yarnpkg.com/@nitrots/nitro-renderer/-/nitro-renderer-1.4.8.tgz#f88bd034036396b2f303218c2343ce0afe1106f5" + integrity sha512-5MAdomgBEt4/RYFWtYm4xhNjOZjlZikdppLusKb4rJYUUl6ZhHxSCdTe2IiyxrDFM2Q19Okub0FzIsOaYEei8A== dependencies: "@pixi/app" "~6.4.2" "@pixi/basis" "~6.4.2"