Skip to content

Commit

Permalink
Remove URL from setting description
Browse files Browse the repository at this point in the history
It does not always make sense, for example if using it for the URL then
it could say that dev.coder.com was the last URL used for dev.coder.com.
  • Loading branch information
code-asher committed Sep 12, 2024
1 parent ac91ba5 commit 16b9788
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/main/kotlin/com/coder/gateway/settings/CoderSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ enum class Source {
/**
* Return a description of the source.
*/
fun description(name: String, url: URL): String = when (this) {
fun description(name: String): String = when (this) {
CONFIG -> "This $name was pulled from your global CLI config."
DEPLOYMENT_CONFIG -> "This $name was pulled from your CLI config for ${url.host}."
LAST_USED -> "This last used $name for ${url.host}."
QUERY -> "This $name was pulled from the Gateway link from ${url.host}."
USER -> "The last used $name for ${url.host}."
DEPLOYMENT_CONFIG -> "This $name was pulled from your deployment's CLI config."
LAST_USED -> "This was the last used $name."
QUERY -> "This $name was pulled from the Gateway link."
USER -> "This was the last used $name."
ENVIRONMENT -> "This $name was pulled from an environment variable."
SETTINGS -> "This $name was pulled from your settings for Coder Gateway."
SETTINGS -> "This $name was pulled from your settings."
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/coder/gateway/util/Dialogs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class DialogUi(
ask(
title = "Session Token",
description = error
?: token?.second?.description("token", url)
?: token?.second?.description("token")
?: "No existing token for ${url.host} found.",
placeholder = token?.first,
link = Pair("Session Token:", getTokenUrl.toString()),
Expand Down

0 comments on commit 16b9788

Please sign in to comment.