]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/helpers/AlttpBaseRomContext.js
update react
[alttp.git] / resources / js / helpers / AlttpBaseRomContext.js
index 70ca6adf0152e85ce84385343a4675937005daaf..87f1345a61b03994cfc26f42fdfd39f5c06e7597 100644 (file)
@@ -28,14 +28,16 @@ const AlttpBaseRomProvider = ({ children }) => {
                }
        }, [setRom]);
 
-       React.useEffect(async () => {
-               const stored = await localforage.getItem('alttpBaseRom');
-               if (stored) {
-                       const crc = CRC32.buf(new Uint8Array(stored));
-                       if (crc == 0x3322EFFC) {
-                               setRom(stored);
+       React.useEffect(() => {
+               (async () => {
+                       const stored = await localforage.getItem('alttpBaseRom');
+                       if (stored) {
+                               const crc = CRC32.buf(new Uint8Array(stored));
+                               if (crc == 0x3322EFFC) {
+                                       setRom(stored);
+                               }
                        }
-               }
+               })();
        }, []);
 
        return <AlttpBaseRomContext.Provider value={{ rom, setRom: setRomCallback }}>