perf: getEnvironment() -> env (#2636)

This commit is contained in:
Simon He
2023-06-01 11:23:38 +08:00
committed by GitHub
parent e1314730be
commit fc9462eee9
16 changed files with 70 additions and 86 deletions

View File

@@ -1,8 +1,8 @@
import { config, getEnvironment } from './config';
import { config, env } from './config';
import { isValidIPAddress } from './is-valid-ip-address';
let prefixUrl = '/';
if (typeof window === 'undefined' || getEnvironment().isDesktop) {
if (typeof window === 'undefined' || env.isDesktop) {
// SSR or Desktop
const serverAPI = config.serverAPI;
if (isValidIPAddress(serverAPI.split(':')[0])) {