X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fhelpers%2FAlttpBaseRomContext.js;h=87f1345a61b03994cfc26f42fdfd39f5c06e7597;hb=eb6958dcb4a2f01b9997da12aee558a54a994a46;hp=70ca6adf0152e85ce84385343a4675937005daaf;hpb=d060f4ab88178bb7e673cf51cd9c3cf6f7cbdb3a;p=alttp.git diff --git a/resources/js/helpers/AlttpBaseRomContext.js b/resources/js/helpers/AlttpBaseRomContext.js index 70ca6ad..87f1345 100644 --- a/resources/js/helpers/AlttpBaseRomContext.js +++ b/resources/js/helpers/AlttpBaseRomContext.js @@ -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