Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 894d56e

Browse files
committed
impl: update URI handling page title instead of creating a new page
Similar with the initial setup page we can use the new TBX API to update the title of the uri handling page without recreating it and using hacks to force TBX to update the internal state.
1 parent 1cbe9ed commit 894d56e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class CoderRemoteProvider(
6363
// On the first load, automatically log in if we can.
6464
private var firstRun = true
6565
private val isInitialized: MutableStateFlow<Boolean> = MutableStateFlow(false)
66-
private var coderHeaderPage = NewEnvironmentPage(context.i18n.pnotr(context.deploymentUrl.toString()))
66+
private val coderHeaderPage = NewEnvironmentPage(context.i18n.pnotr(context.deploymentUrl.toString()))
6767
private val linkHandler = CoderProtocolHandler(context, dialogUi, isInitialized)
6868

6969
override val environments: MutableStateFlow<LoadableState<List<CoderRemoteEnvironment>>> = MutableStateFlow(
@@ -317,7 +317,7 @@ class CoderRemoteProvider(
317317
close()
318318
// start initialization with the new settings
319319
this@CoderRemoteProvider.client = restClient
320-
coderHeaderPage = NewEnvironmentPage(context.i18n.pnotr(restClient.url.toString()))
320+
coderHeaderPage.setTitle(context.i18n.pnotr(restClient.url.toString()))
321321

322322
environments.showLoadingMessage()
323323
pollJob = poll(restClient, cli)

0 commit comments

Comments
 (0)