Skip to content

Commit e014646

Browse files
authored
fix: account dropdown not refreshed when switching users on the same … (#323)
…deployment via URI When two Coder URIs targeting the same deployment URL but different users are opened in sequence, the account dropdown in the plugin header would still show the username from the first session instead of updating to reflect the newly authenticated user. This happened because the same-URL URI handling path calls refreshSession() directly, bypassing the onConnect callback that normally updates the account dropdown label after a successful connection. While refreshSession() correctly replaced the REST client and CLI instances with ones authenticated as the new user, it never propagated that change to the UI. The fix updates refreshSession() to also refresh the account dropdown label and visibility immediately after the new client is initialized, keeping the UI consistent with the active session. - resolves DEVEX-372 - resolves DEVEX-374
1 parent cac1571 commit e014646

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,8 @@ class CoderRemoteProvider(
531531
this.client = newRestClient
532532
this.cli = newCli
533533
lastEnvironments.forEach { it.updateClientAndCli(newRestClient, newCli) }
534+
accountDropdownField.labelState.update { context.i18n.pnotr(newRestClient.me.username) }
535+
accountDropdownField.visibility.update { true }
534536
coderHeaderPage.resetFilter()
535537
context.cs.launch(CoroutineName("Load Templates")) { coderHeaderPage.reloadTemplates() }
536538
pollJob = poll(newRestClient, newCli)

0 commit comments

Comments
 (0)