Skip to content

Commit

Permalink
fix(files): render snekFinder even without initBackendLink
Browse files Browse the repository at this point in the history
This change updates the rendering behaviour of the SnekFinder.
Before the loading state of the SnekFinder was always true, unless
a initBackendLink was set. Due to this, the rendering of the SnekFinder
failed for all applications that did not set the initBackendLink through
`jaen-pages.json` or cache.

Now the loading state is set to false regardless of the initBackendLink.
Without the initBackendLink,
```js
localStorage.removeItem('snek-finder-osg-backend-root')
```
is called to remove the cached snekFinder data.
  • Loading branch information
schettn authored Nov 30, 2021
1 parent 001ee86 commit 6517d31
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/jaen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@
"react-redux": "^7.2.6",
"react-use-analytics-api": "^1.4.16",
"typescript": "^4.3.5",
"uuid": "^8.3.2"
"uuid": "^8.3.2",
"gatsby-alias-imports": "^1.0.6",
"gatsby-plugin-compile-es6-packages": "^2.1.1",
"gatsby-plugin-emotion": "^7.2.0",
"gatsby-plugin-image": "^2.2.0",
"gatsby-plugin-react-helmet": "^5.2.0",
"gatsby-plugin-sharp": "^4.2.0",
"gatsby-source-filesystem": "^4.2.0",
"gatsby-transformer-sharp": "^4.2.0"
},
"devDependencies": {
"@snek-at/storybook-addon-chakra-ui": "^1.0.0-beta.1",
Expand All @@ -72,15 +80,7 @@
"babel-plugin-inline-react-svg": "^2.0.1",
"babel-plugin-relative-path-import": "^2.0.1",
"babel-preset-gatsby-package": "^2.2.0",
"gatsby-alias-imports": "^1.0.6",
"gatsby-plugin-compile-es6-packages": "^2.1.1",
"gatsby-plugin-emotion": "^7.2.0",
"gatsby-plugin-image": "^2.2.0",
"gatsby-plugin-react-helmet": "^5.2.0",
"gatsby-plugin-sharp": "^4.2.0",
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.24",
"gatsby-source-filesystem": "^4.2.0",
"gatsby-transformer-sharp": "^4.2.0",
"isomorphic-fetch": "^3.0.0"
}
}
3 changes: 3 additions & 0 deletions packages/jaen/src/containers/SnekFinder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ const Finder: React.FC<FinderProps> = ({mode = 'browser', ...props}) => {
}

run()
} else {
localStorage.removeItem('snek-finder-osg-backend-root')
setLoading(false)
}
})

Expand Down

0 comments on commit 6517d31

Please sign in to comment.