Skip to content

Commit 2c7365c

Browse files
committed
Updated login badge
1 parent 617b04d commit 2c7365c

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/deepcode/lib/modules/BaseDeepCodeModule.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ export default abstract class BaseDeepCodeModule implements DeepCode.BaseDeepCod
138138

139139
// Leave viewId undefined to remove the badge from all views
140140
async setLoadingBadge(value: boolean): Promise<void> {
141+
console.error("setLoadingBadge", value);
142+
if (this.progressBadgeResolveFn) this.progressBadgeResolveFn();
141143
if (value) {
142144
// Using closure on this to allow partial binding in arbitrary positions
143145
const self = this;
@@ -151,7 +153,6 @@ export default abstract class BaseDeepCodeModule implements DeepCode.BaseDeepCod
151153
})
152154
);
153155
} else {
154-
if (this.progressBadgeResolveFn) this.progressBadgeResolveFn();
155156
this.progressBadgePromise = undefined;
156157
this.progressBadgeResolveFn = undefined;
157158
}

src/deepcode/lib/modules/LoginModule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ abstract class LoginModule extends ReportModule implements DeepCode.LoginModuleI
4444
if (this.token) {
4545
try {
4646
validSession = !!(await http.checkSession(this.baseURL, this.token));
47-
if (!validSession) await this.setLoadingBadge(true);
4847
} catch (err) {
4948
await this.processError(err, {
5049
message: errorsLogs.loginStatus
5150
});
5251
}
5352
}
5453
await this.setContext(DEEPCODE_CONTEXT.LOGGEDIN, validSession);
54+
if (!validSession) await this.setLoadingBadge(true);
5555
return validSession;
5656
}
5757

0 commit comments

Comments
 (0)