Skip to content

Commit bdbf063

Browse files
committed
chore: internally disable extension on bootstrap error
If the broker could not be contacted during bootstrapping, we internally disable SSO and account switching. Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
1 parent b7f781c commit bdbf063

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/background.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ let broker_state_received = new Deferred();
3434
* Check if all conditions for SSO are met
3535
*/
3636
function is_operational() {
37-
return Boolean(accountManager.isActive() && accountManager.getActive());
37+
return Boolean(
38+
!is_in_error_state() &&
39+
accountManager.isActive() &&
40+
accountManager.getActive(),
41+
);
3842
}
3943

4044
/*
@@ -150,6 +154,10 @@ function notify_state_change(ui_only = false) {
150154
}
151155

152156
async function on_message_menu(request) {
157+
if (is_in_error_state()) {
158+
notify_state_change(true);
159+
return;
160+
}
153161
if (request.command == "enable") {
154162
accountManager.setActive(true);
155163
const account = accountManager.selectAccount(request.username);

0 commit comments

Comments
 (0)