fix(electron): add dedicated api for opening external links in the default browser (#6166)

This commit is contained in:
Peng Xiao
2024-03-18 06:41:47 +00:00
parent 8301d82548
commit 386bd033af
2 changed files with 7 additions and 4 deletions

View File

@@ -1,3 +1,4 @@
import { apis } from '@affine/electron-api';
import {
generateRandUTF16Chars,
getBaseUrl,
@@ -62,13 +63,12 @@ export const signInCloud = async (
.catch(err => onRejectHandleTrace(err, traceParams));
} else if (OAuthProviderType[provider]) {
if (environment.isDesktop) {
open(
await apis?.ui.openExternal(
`${
runtimeConfig.serverUrlPrefix
}/desktop-signin?provider=${provider}&redirect_uri=${buildRedirectUri(
'/open-app/signin-redirect'
)}`,
'_target'
)}`
);
} else {
location.href = `${