From 3c81d34f20b32c57d812d11ae5d20a6efe9580f8 Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Fri, 6 May 2022 21:33:09 +0200 Subject: [PATCH] Read custom delay only in dev or test mode Signed-off-by: Tilman Vatteroth --- src/components/application-loader/initializers/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/application-loader/initializers/index.ts b/src/components/application-loader/initializers/index.ts index 0a5507bc5..85e6b2059 100644 --- a/src/components/application-loader/initializers/index.ts +++ b/src/components/application-loader/initializers/index.ts @@ -10,14 +10,16 @@ import { fetchMotd } from './fetch-motd' import { fetchAndSetUser } from '../../login-page/auth/utils' import { fetchFrontendConfig } from './fetch-frontend-config' import { loadDarkMode } from './load-dark-mode' +import { isDevMode, isTestMode } from '../../../utils/test-modes' const customDelay: () => Promise = async () => { if ( + (isDevMode || isTestMode) && typeof window !== 'undefined' && typeof window.localStorage !== 'undefined' && (window.location.search.startsWith('?customDelay=') || window.localStorage.getItem('customDelay')) ) { - return new Promise((resolve) => setTimeout(resolve, 5000)) + return new Promise((resolve) => setTimeout(resolve, 500000000)) } else { return Promise.resolve() }