mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 09:46:30 -05:00
Read custom delay only in dev or test mode
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
1a18f3fc6f
commit
3c81d34f20
1 changed files with 3 additions and 1 deletions
|
@ -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<void> = 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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue