Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.

Commit

Permalink
Closes #36
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecorry31 committed Feb 7, 2019
1 parent 57bade4 commit c7ef1d7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function init() {}
function enable() {

this._lastMuteState = false;
this._hasMutedSound = false;

this._disturbToggle = new Widget.DoNotDisturbToggle();
this._disturbToggle.show();
Expand Down Expand Up @@ -50,7 +51,7 @@ function disable() {
this._notificationManager.disconnectAll();
this._notificationManager.disable();
let muteSounds = this._settings.shouldMuteSound();
if (muteSounds){
if (muteSounds && this._hasMutedSound){
this._soundManager.unmute();
}
}
Expand Down Expand Up @@ -84,8 +85,10 @@ function _sync() {

if (enabled && muteSounds) {
this._soundManager.mute();
} else if (muteSounds || this._lastMuteState) {
this._hasMutedSound = true;
} else if ((muteSounds || this._lastMuteState) && this._hasMutedSound) {
this._soundManager.unmute();
this._hasMutedSound = false;
}

this._lastMuteState = muteSounds;
Expand Down

0 comments on commit c7ef1d7

Please sign in to comment.