Skip to content

Commit 426cc98

Browse files
phorcys420jakehwll
andauthored
fix(site/src/modules/apps): distinguish JB Toolbox from Gateway (#20830)
Edits the "To use <APP>, you need to have Jetbrains Toolbox installed" error message to vary based on JetBrains Toolbox vs. Gateway. --------- Co-authored-by: Jake Howell <jake@hwll.me>
1 parent 007f2df commit 426cc98

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

site/src/modules/apps/useAppLink.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,19 @@ export const useAppLink = (
5858
const openAppExternallyFailedTimeout = 500;
5959
const openAppExternallyFailed = setTimeout(() => {
6060
// Check if this is a JetBrains IDE app
61-
const isJetBrainsApp =
62-
app.url &&
63-
(app.url.startsWith("jetbrains-gateway:") ||
64-
app.url.startsWith("jetbrains:"));
61+
// starts with "jetbrains-gateway://connect#type=coder" (from https://registry.coder.com/modules/coder/jetbrains-gateway)
62+
const isJetBrainsGateway = app.url?.startsWith("jetbrains-gateway:");
63+
// starts with "jetbrains://gateway/coder" (from https://registry.coder.com/modules/coder/jetbrains)
64+
const isJetBrainsToolbox = app.url?.startsWith("jetbrains:");
6565

6666
// Check if this is a coder:// URL
6767
const isCoderApp = app.url?.startsWith("coder:");
6868

69-
if (isJetBrainsApp) {
69+
if (isJetBrainsGateway) {
70+
displayError(
71+
`To use ${label}, you need to have JetBrains Gateway installed.`,
72+
);
73+
} else if (isJetBrainsToolbox) {
7074
displayError(
7175
`To use ${label}, you need to have JetBrains Toolbox installed.`,
7276
);

0 commit comments

Comments
 (0)