Skip to content

Commit

Permalink
Always dispatch feedback message for "ToggleState"
Browse files Browse the repository at this point in the history
(with `reallyChanged: false` flag)
(#213)
  • Loading branch information
Infocatcher committed Jul 4, 2016
1 parent bff5b02 commit 1cb4e8d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ var remoteFrameHandler = {
break;
case "ToggleState":
var isPrivate = data.isPrivate;
var needChange = true;
if(isPrivate === undefined)
isPrivate = !this.isPrivate;
else if(isPrivate == this.isPrivate) // Nothing to do
break;
this.isPrivate = isPrivate;
if(!data.silent)
sendAsyncMessage("PrivateTab:PrivateChanged", { isPrivate: isPrivate });
needChange = false;
if(needChange)
this.isPrivate = isPrivate;
!data.silent && sendAsyncMessage("PrivateTab:PrivateChanged", {
isPrivate: isPrivate,
reallyChanged: needChange
});
break;
case "WaitLoading":
var webProgress = docShell.QueryInterface(Components.interfaces.nsIWebProgress);
Expand Down

0 comments on commit 1cb4e8d

Please sign in to comment.