Skip to content

Commit 95801cf

Browse files
committed
impl: display the app name instead of the URL
Handles both normal case and URI handling
1 parent cdaf544 commit 95801cf

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class CoderRemoteProvider(
227227
val url = context.settingsStore.workspaceCreateUrl ?: client?.url?.withPath("/templates").toString()
228228
context.desktop.browse(
229229
url
230-
.replace("\$workspaceOwner", client?.me()?.username ?: "")
230+
.replace("\$workspaceOwner", client?.me?.username ?: "")
231231
) {
232232
context.ui.showErrorInfoPopup(it)
233233
}
@@ -333,8 +333,11 @@ class CoderRemoteProvider(
333333
}
334334
context.logger.info("Starting initialization with the new settings")
335335
this@CoderRemoteProvider.client = restClient
336-
coderHeaderPage.setTitle(context.i18n.pnotr(restClient.url.toString()))
337-
336+
if (context.settingsStore.useAppNameAsTitle) {
337+
coderHeaderPage.setTitle(context.i18n.pnotr(restClient.appName))
338+
} else {
339+
coderHeaderPage.setTitle(context.i18n.pnotr(restClient.url.toString()))
340+
}
338341
environments.showLoadingMessage()
339342
pollJob = poll(restClient, cli)
340343
context.logger.info("Workspace poll job with name ${pollJob.toString()} was created while handling URI $uri")
@@ -421,7 +424,11 @@ class CoderRemoteProvider(
421424
context.logger.info("Cancelled workspace poll job ${pollJob.toString()} in order to start a new one")
422425
}
423426
environments.showLoadingMessage()
424-
coderHeaderPage.setTitle(context.i18n.pnotr(client.url.toString()))
427+
if (context.settingsStore.useAppNameAsTitle) {
428+
coderHeaderPage.setTitle(context.i18n.pnotr(client.appName))
429+
} else {
430+
coderHeaderPage.setTitle(context.i18n.pnotr(client.url.toString()))
431+
}
425432
context.logger.info("Displaying ${client.url} in the UI")
426433
pollJob = poll(client, cli)
427434
context.logger.info("Workspace poll job with name ${pollJob.toString()} was created")

0 commit comments

Comments
 (0)