Skip to content

Commit 8938475

Browse files
authored
hide progress indicator when connection refresh is done by codewhisperer (#4492)
1 parent 340645e commit 8938475

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix recurring popup \"refreshing token\" whne users're typing in the IDE and Q connection expires"
4+
}

plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/services/codewhisperer/service/CodeWhispererService.kt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,16 @@ class CodeWhispererService {
105105
return
106106
}
107107

108-
if (promptReAuth(project)) return
109-
110-
if (isQExpired(project)) return
108+
if (isQExpired(project)) {
109+
// The purpose to execute in the background is to hide the progress indicator UI
110+
val shouldReauth = ApplicationManager.getApplication().executeOnPooledThread<Boolean> {
111+
promptReAuth(project)
112+
}.get()
113+
114+
if (shouldReauth) {
115+
return
116+
}
117+
}
111118

112119
latencyContext.credentialFetchingEnd = System.nanoTime()
113120
val psiFile = runReadAction { PsiDocumentManager.getInstance(project).getPsiFile(editor.document) }

0 commit comments

Comments
 (0)