mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 11:16:31 -05:00
Accept url parameter for custom delay
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
bd58bca39c
commit
1a18f3fc6f
1 changed files with 5 additions and 1 deletions
|
@ -12,7 +12,11 @@ import { fetchFrontendConfig } from './fetch-frontend-config'
|
|||
import { loadDarkMode } from './load-dark-mode'
|
||||
|
||||
const customDelay: () => Promise<void> = async () => {
|
||||
if (window.localStorage.getItem('customDelay')) {
|
||||
if (
|
||||
typeof window !== 'undefined' &&
|
||||
typeof window.localStorage !== 'undefined' &&
|
||||
(window.location.search.startsWith('?customDelay=') || window.localStorage.getItem('customDelay'))
|
||||
) {
|
||||
return new Promise((resolve) => setTimeout(resolve, 5000))
|
||||
} else {
|
||||
return Promise.resolve()
|
||||
|
|
Loading…
Reference in a new issue