fix(env): is mobile flag (#8005)

only 'mobile' entry has isMobile = true flag
This commit is contained in:
EYHN
2024-09-04 09:21:36 +00:00
parent 53886a7cd3
commit 2524491bd1
78 changed files with 169 additions and 205 deletions

View File

@@ -88,7 +88,7 @@ export class AuthService extends Service {
email,
// we call it [callbackUrl] instead of [redirect_uri]
// to make it clear the url is used to finish the sign-in process instead of redirect after signed-in
callbackUrl: `/magic-link?client=${environment.isDesktop ? appInfo?.schema : 'web'}`,
callbackUrl: `/magic-link?client=${environment.isElectron ? appInfo?.schema : 'web'}`,
}),
headers: {
'content-type': 'application/json',
@@ -131,7 +131,7 @@ export class AuthService extends Service {
'state',
JSON.stringify({
state: oauthUrl.searchParams.get('state'),
client: environment.isDesktop ? appInfo?.schema : 'web',
client: environment.isElectron ? appInfo?.schema : 'web',
})
);
url = oauthUrl.toString();

View File

@@ -5,7 +5,7 @@ import { fromPromise, Service } from '@toeverything/infra';
import { BackendError, NetworkError } from '../error';
export function getAffineCloudBaseUrl(): string {
if (environment.isDesktop) {
if (environment.isElectron) {
return runtimeConfig.serverUrlPrefix;
}
const { protocol, hostname, port } = window.location;

View File

@@ -28,7 +28,7 @@ const getDefaultSubscriptionSuccessCallbackLink = (
plan === SubscriptionPlan.AI ? '/ai-upgrade-success' : '/upgrade-success';
const urlString = getAffineCloudBaseUrl() + path;
const url = new URL(urlString);
if (environment.isDesktop && appInfo) {
if (environment.isElectron && appInfo) {
url.searchParams.set('schema', appInfo.schema);
}
return url.toString();