Auto reload and bug fixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {getUserInfo} from './utils';
|
||||
import {getUserInfo} from './utils/utils';
|
||||
|
||||
export async function getUserName(): Promise<string> {
|
||||
const info = await getUserInfo();
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user