Skip to content

Commit

Permalink
fix: useCloudCerberus debug模式下不执行preload
Browse files Browse the repository at this point in the history
  • Loading branch information
m860 committed Jun 10, 2020
1 parent c994ddc commit 1b8b7f0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions hooks/useCloudCerberus.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,17 @@ export function useCloudCerberus(props: CloudCerberusProps): Object {
});

React.useEffect(() => {
// preload
preload({
secret: secret,
bundleCache: bundleCacheInstance
})
if (debug) {
// preload
preload({
secret: secret,
bundleCache: bundleCacheInstance
})
}
return () => {
//TODO abort fetch
}
}, []);
}, [debug]);

return defined;
}

0 comments on commit 1b8b7f0

Please sign in to comment.