Auto reload and bug fixes

This commit is contained in:
Sebastian Seedorf
2020-11-14 19:38:16 +01:00
parent 5a56fc26d2
commit 6189b95b6e
22 changed files with 265 additions and 47 deletions

View File

@@ -29,6 +29,8 @@ module.exports = {
"no-void": "error",
"comma-spacing": "error",
"comma-dangle": ["error", "always-multiline"],
"comma-style": "error",
"semi": "error",
"no-restricted-imports": ["error",
"assert", "buffer", "child_process", "cluster", "crypto", "dgram", "dns", "domain", "events", "freelist",

View File

@@ -1,4 +1,4 @@
import {getUserInfo} from './utils';
import {getUserInfo} from './utils/utils';
export async function getUserName(): Promise<string> {
const info = await getUserInfo();

View File

@@ -1,7 +1,5 @@
// Export setConfig so that the external url can set set automatically
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export {setConfig} from './utils';
// Export setConfig so that the external url can set set automatically by the server
export {setConfig} from './utils/utils';
import {getUserName} from './SomeModule';

View File

@@ -17,7 +17,7 @@ export function getConfig(): Promise<ClientConfig> {
}
export async function getUserInfo(): Promise<UserInfo|undefined> {
const getBaseUrl = await getConfig();
const res = await fetch(getBaseUrl.EXTERNAL_BASE_URL + "/api/user");
const config = await getConfig();
const res = await fetch(config.EXTERNAL_BASE_URL + "/api/user");
return res.json();
}