Skip to content

Commit 7d661db

Browse files
authored
Improve CodeWhisperer sign-in flow by directly showing ToS after token validation (#3196)
1 parent 305e5b1 commit 7d661db

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

jetbrains-core/src/software/aws/toolkits/jetbrains/services/codewhisperer/credentials/TokenDialog.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.intellij.openapi.Disposable
77
import com.intellij.openapi.actionSystem.AnAction
88
import com.intellij.openapi.actionSystem.AnActionEvent
99
import com.intellij.openapi.actionSystem.LangDataKeys
10+
import com.intellij.openapi.application.ApplicationManager
1011
import com.intellij.openapi.project.Project
1112
import com.intellij.openapi.ui.DialogPanel
1213
import com.intellij.openapi.ui.DialogWrapper
@@ -94,6 +95,11 @@ class TokenDialog(private val project: Project) : DialogWrapper(project), Dispos
9495
close(OK_EXIT_CODE)
9596
CodeWhispererExplorerActionManager.getInstance().refreshCodeWhispererNode(project)
9697
notifyInfo("Amazon CodeWhisperer", message("codewhisperer.explorer.token.success"), project)
98+
99+
// Modal change
100+
ApplicationManager.getApplication().invokeLater {
101+
CodeWhispererExplorerActionManager.getInstance().enableCodeWhisperer(project)
102+
}
97103
}
98104
} catch (e: CodeWhispererException) {
99105
LOGGER.debug { e.message.toString() }

jetbrains-core/src/software/aws/toolkits/jetbrains/services/codewhisperer/explorer/CodeWhispererExplorerActionManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ internal class CodeWhispererExplorerActionManager : PersistentStateComponent<Cod
100100
BrowserUtil.browse(uri)
101101
}
102102

103-
private fun enableCodeWhisperer(project: Project) {
103+
fun enableCodeWhisperer(project: Project) {
104104
showCodeWhispererToS(project)
105105
}
106106

0 commit comments

Comments
 (0)