Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): email links in chat open the mail app #31175

Openjuliusmarmingewants to merge 6 commits intomain fromrefs/pull/31175/headopened View on GitHub

Showing 3 changed files with 19 additions and 4 deletions.

x
0 of 3 viewed, 3 left
12 additions and 0 deletionsapps/desktop/src/electron/ElectronShell.test.tsModified
View file
@@ -54,6 +54,18 @@
}).pipe(Effect.provide(ElectronShell.layer)),
);
​
+ it.effect("opens mailto links in the system mail client", () =>
+ Effect.gen(function* () {
+ openExternalMock.mockResolvedValue(undefined);
+​
+ const electronShell = yield* ElectronShell.ElectronShell;
+ const result = yield* electronShell.openExternal("mailto:someone@example.com");
+​
+ assert.equal(result, true);
+ assert.deepEqual(openExternalMock.mock.calls, [["mailto:someone@example.com"]]);
+ }).pipe(Effect.provide(ElectronShell.layer)),
+ );
+​
it.effect("opens only the Grok Bot prompt link", () =>
Effect.gen(function* () {
openExternalMock.mockResolvedValue(undefined);
2 additions and 2 deletionsapps/desktop/src/electron/ElectronShell.tsModified
View file
@@ -13,7 +13,7 @@
import * as Electron from "electron";
​
// Remote editor deep links and local editor file links must reach the OS handler.
-const SAFE_WEB_PROTOCOLS = new Set(["http:", "https:"]);
+const SAFE_EXTERNAL_PROTOCOLS = new Set(["http:", "https:", "mailto:"]);
const REMOTE_EDITOR_PROTOCOLS = new Set(