Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 7f8df3b

Browse files
Hubert KosterHubert Koster
authored andcommitted
chore: refactoring code
1 parent a212f02 commit 7f8df3b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/utils/index.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,14 @@ export const formatTokenScope = (tokenScope: string) => {
121121
};
122122

123123
export const getServerConfig = () => {
124-
const config_server_url = localStorage.getItem('config.server_url');
125-
const config_app_id = localStorage.getItem('config.app_id');
126-
if (config_app_id && config_server_url) {
124+
const isBrowser = getIsBrowser();
125+
if (isBrowser) {
126+
const config_server_url = localStorage.getItem('config.server_url');
127+
const config_app_id = localStorage.getItem('config.app_id');
127128
return {
128-
serverUrl: config_server_url,
129-
appId: config_app_id,
130-
oauth: config_server_url,
129+
serverUrl: config_server_url ?? DEFAULT_WS_SERVER,
130+
appId: config_app_id ?? getAppId(),
131+
oauth: config_server_url ?? OAUTH_URL,
131132
};
132133
} else {
133134
return {

0 commit comments

Comments
 (0)