Skip to content

Commit

Permalink
link fix for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketfuryrocks committed Nov 4, 2020
1 parent 8fe218f commit 080af68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/types/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ declare global {
let linkApi: {
lock: boolean,
/**
* true if loaded, if false means preloaded but no loaded
* Element if loaded, if false means preloaded but no loaded
*/
chunksStatusMap: {
[key: string]: boolean
[key: string]: boolean | Element
}
loadMap: (url: string) => Promise<pathsCacheElement>
preloadPage: (url: string) => Promise<void>
Expand Down
7 changes: 5 additions & 2 deletions src/web/LinkApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ FireJSX.linkApi = {
},
loadChunk(chunk) {
//if true, then already loaded
if (this.chunksStatusMap[chunk])
return;
{
const stausMap = this.chunksStatusMap[chunk];
if (stausMap)
return stausMap;
}
let ele;
if (chunk.endsWith(".js")) {
ele = document.createElement("script");
Expand Down

0 comments on commit 080af68

Please sign in to comment.