From 8e746e733d4bda58d8b71025d9d787ca7108d7bf Mon Sep 17 00:00:00 2001 From: Riku Rouvila Date: Thu, 1 Sep 2022 13:59:10 +0300 Subject: [PATCH] fix app main loader spinning infinitely when reading storage and other preparation takes more time than the minimum time for the loader to be visible --- packages/client/src/components/ProtectedPage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/ProtectedPage.tsx b/packages/client/src/components/ProtectedPage.tsx index 5c11197cf2a..fbe2f90851e 100644 --- a/packages/client/src/components/ProtectedPage.tsx +++ b/packages/client/src/components/ProtectedPage.tsx @@ -88,7 +88,9 @@ class ProtectedPageComponent extends React.Component { 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