mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 03:27:05 -04: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 { fetchAndSetUser } from '../../login-page/auth/utils'
|
||||||
import { fetchFrontendConfig } from './fetch-frontend-config'
|
import { fetchFrontendConfig } from './fetch-frontend-config'
|
||||||
import { loadDarkMode } from './load-dark-mode'
|
import { loadDarkMode } from './load-dark-mode'
|
||||||
|
import { isDevMode, isTestMode } from '../../../utils/test-modes'
|
||||||
|
|
||||||
const customDelay: () => Promise<void> = async () => {
|
const customDelay: () => Promise<void> = async () => {
|
||||||
if (
|
if (
|
||||||
|
(isDevMode || isTestMode) &&
|
||||||
typeof window !== 'undefined' &&
|
typeof window !== 'undefined' &&
|
||||||
typeof window.localStorage !== 'undefined' &&
|
typeof window.localStorage !== 'undefined' &&
|
||||||
(window.location.search.startsWith('?customDelay=') || window.localStorage.getItem('customDelay'))
|
(window.location.search.startsWith('?customDelay=') || window.localStorage.getItem('customDelay'))
|
||||||
) {
|
) {
|
||||||
return new Promise((resolve) => setTimeout(resolve, 5000))
|
return new Promise((resolve) => setTimeout(resolve, 500000000))
|
||||||
} else {
|
} else {
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue