mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-25 04:24:43 -04:00
fix: suppress error when fetching user information in application loader
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
5e06e4ab3c
commit
f3450d66a9
1 changed files with 12 additions and 1 deletions
|
@ -11,6 +11,9 @@ 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'
|
import { isDevMode, isTestMode } from '../../../utils/test-modes'
|
||||||
|
import { Logger } from '../../../utils/logger'
|
||||||
|
|
||||||
|
const logger = new Logger('Application Loader')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a custom delay in the loading of the application.
|
* Create a custom delay in the loading of the application.
|
||||||
|
@ -33,6 +36,14 @@ export interface InitTask {
|
||||||
task: () => Promise<void>
|
task: () => Promise<void>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fetchUserInformation = async (): Promise<void> => {
|
||||||
|
try {
|
||||||
|
await fetchAndSetUser()
|
||||||
|
} catch (error) {
|
||||||
|
logger.error("Couldn't load user. Probably not logged in.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a list of tasks, that need to be fulfilled on startup.
|
* Create a list of tasks, that need to be fulfilled on startup.
|
||||||
*/
|
*/
|
||||||
|
@ -52,7 +63,7 @@ export const createSetUpTaskList = (): InitTask[] => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Fetch user information',
|
name: 'Fetch user information',
|
||||||
task: fetchAndSetUser
|
task: fetchUserInformation
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Motd',
|
name: 'Motd',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue