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,4 +1,4 @@
import { app, nativeTheme } from 'electron';
import { app, nativeTheme, shell } from 'electron';
import { getLinkPreview } from 'link-preview-js';
import { isMacOS } from '../../shared/utils';
@@ -122,4 +122,7 @@ export const uiHandlers = {
};
}
},
openExternal(_, url: string) {
return shell.openExternal(url);
},
} satisfies NamespaceHandlers;