mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
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>
This commit is contained in:
@@ -58,15 +58,19 @@ export const useAppLink = (
|
||||
const openAppExternallyFailedTimeout = 500;
|
||||
const openAppExternallyFailed = setTimeout(() => {
|
||||
// Check if this is a JetBrains IDE app
|
||||
const isJetBrainsApp =
|
||||
app.url &&
|
||||
(app.url.startsWith("jetbrains-gateway:") ||
|
||||
app.url.startsWith("jetbrains:"));
|
||||
// starts with "jetbrains-gateway://connect#type=coder" (from https://registry.coder.com/modules/coder/jetbrains-gateway)
|
||||
const isJetBrainsGateway = app.url?.startsWith("jetbrains-gateway:");
|
||||
// starts with "jetbrains://gateway/coder" (from https://registry.coder.com/modules/coder/jetbrains)
|
||||
const isJetBrainsToolbox = app.url?.startsWith("jetbrains:");
|
||||
|
||||
// Check if this is a coder:// URL
|
||||
const isCoderApp = app.url?.startsWith("coder:");
|
||||
|
||||
if (isJetBrainsApp) {
|
||||
if (isJetBrainsGateway) {
|
||||
displayError(
|
||||
`To use ${label}, you need to have JetBrains Gateway installed.`,
|
||||
);
|
||||
} else if (isJetBrainsToolbox) {
|
||||
displayError(
|
||||
`To use ${label}, you need to have JetBrains Toolbox installed.`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user