Skip to content

Commit

Permalink
Merge pull request #3882 from opencrvs/1.0.0-loader-fix
Browse files Browse the repository at this point in the history
fix app main loader spinning infinitely when reading storage and othe…
  • Loading branch information
euanmillar authored Sep 1, 2022
2 parents 883f9c5 + 8e746e7 commit 221a5aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/client/src/components/ProtectedPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ class ProtectedPageComponent extends React.Component<Props, IProtectPageState> {

async componentDidMount() {
setTimeout(this.setLoadingTimeOut, LOADER_MIN_DISPLAY_TIME)
const newState = { ...this.state }

const { loadingTimeout, ...stateWithoutLoadingTimeout } = this.state
const newState = { ...stateWithoutLoadingTimeout }

if (await storage.getItem(SCREEN_LOCK)) {
newState.secured = false
Expand Down

0 comments on commit 221a5aa

Please sign in to comment.