mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04:00
Sort components (#163)
* Move common components to the `common` directory * rename style directory * Move ForkAwesome to common * Move initializers and restructure application-loader.tsx
This commit is contained in:
parent
f2e273fc40
commit
c949b6950e
125 changed files with 104 additions and 103 deletions
|
@ -0,0 +1,21 @@
|
|||
import { getBackendConfig } from '../../../api/backend-config'
|
||||
import { getFrontendConfig } from '../../../api/frontend-config'
|
||||
import { setBackendConfig } from '../../../redux/backend-config/methods'
|
||||
import { setFrontendConfig } from '../../../redux/frontend-config/methods'
|
||||
import { getAndSetUser } from '../../../utils/apiUtils'
|
||||
|
||||
export const loadAllConfig: (baseUrl: string) => Promise<void> = async (baseUrl) => {
|
||||
const frontendConfig = await getFrontendConfig(baseUrl)
|
||||
if (!frontendConfig) {
|
||||
return Promise.reject(new Error('Frontend config empty!'))
|
||||
}
|
||||
setFrontendConfig(frontendConfig)
|
||||
|
||||
const backendConfig = await getBackendConfig()
|
||||
if (!backendConfig) {
|
||||
return Promise.reject(new Error('Backend config empty!'))
|
||||
}
|
||||
setBackendConfig(backendConfig)
|
||||
|
||||
await getAndSetUser()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue