Skip to content

Commit

Permalink
fixup! simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Oct 17, 2023
1 parent 68392cb commit 260dc77
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions spot-electron/src/application-window/applicationwindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@ function createApplicationWindow() {

let showCrashPageTimeout = null;

let meetingStatus = 0; /* Not in a meeting. */

clientController.addListener('meetingStatus', ({ status }) => {
logger.info(`Current meeting status: ${status}`);

meetingStatus = status;

// Re-evaluate if we should show the offline overlay after coming back from
// a meeting.
if (meetingStatus === 0 && !onlineDetector.getLastOnlineStatus()) {
applicationWindow.loadFile('src/static/offline.html');
// Pause the online detector while in a meeting so it doesn't disrupt them.
// Re-arm it when the meeting ends.
if (status !== 0) {

Check failure on line 38 in spot-electron/src/application-window/applicationwindow.js

View workflow job for this annotation

GitHub Actions / Unit-tests

Unexpected negated condition
onlineDetector.pause();
} else {
onlineDetector.start();
}
});

Expand All @@ -57,12 +55,6 @@ function createApplicationWindow() {

logger.warn(`Online status changed: ${isOnline}`);

if (meetingStatus !== 0) {
logger.debug('Ignoring online state change while in a meeting');

return;
}

if (isOnline) {
applicationWindow.loadURL(defaultSpotURL);
} else {
Expand Down

0 comments on commit 260dc77

Please sign in to comment.