mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
refactor: avoid runtime config object (#8202)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
export function popupWindow(target: string) {
|
||||
const url = new URL(runtimeConfig.serverUrlPrefix + '/redirect-proxy');
|
||||
const url = new URL(BUILD_CONFIG.serverUrlPrefix + '/redirect-proxy');
|
||||
target = /^https?:\/\//.test(target)
|
||||
? target
|
||||
: runtimeConfig.serverUrlPrefix + target;
|
||||
: BUILD_CONFIG.serverUrlPrefix + target;
|
||||
url.searchParams.set('redirect_uri', target);
|
||||
return window.open(url, '_blank', `noreferrer noopener`);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ interface AppUrlOptions {
|
||||
|
||||
export function buildAppUrl(path: string, opts: AppUrlOptions = {}) {
|
||||
// TODO(@EYHN): should use server base url
|
||||
const webBase = runtimeConfig.serverUrlPrefix;
|
||||
const webBase = BUILD_CONFIG.serverUrlPrefix;
|
||||
// TODO(@pengx17): how could we know the corresponding app schema in web environment
|
||||
if (opts.desktop && appInfo?.schema) {
|
||||
const urlCtor = new URL(path, webBase);
|
||||
|
||||
Reference in New Issue
Block a user