From 45b716e162b55cd9c3d76d285ed1632d2ff3050c Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Mon, 5 Oct 2015 14:40:15 +0100 Subject: [PATCH] Bug 1210707 - Feedback view no longer allows closing the window and avoiding leaving feedback. r=mikedeboer --- .../loop/content/js/conversationAppStore.js | 3 ++- .../test/desktop-local/conversationAppStore_test.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/browser/components/loop/content/js/conversationAppStore.js b/browser/components/loop/content/js/conversationAppStore.js index e6a40d147d5c..bc37f2addec5 100644 --- a/browser/components/loop/content/js/conversationAppStore.js +++ b/browser/components/loop/content/js/conversationAppStore.js @@ -147,7 +147,8 @@ loop.store.ConversationAppStore = (function() { this._dispatcher.dispatch(new loop.shared.actions.HangupCall()); break; case "room": - if (this._activeRoomStore.getStoreState().used) { + if (this._activeRoomStore.getStoreState().used && + !this._storeState.showFeedbackForm) { this._dispatcher.dispatch(new loop.shared.actions.LeaveRoom()); } else { loop.shared.mixins.WindowCloseMixin.closeWindow(); diff --git a/browser/components/loop/test/desktop-local/conversationAppStore_test.js b/browser/components/loop/test/desktop-local/conversationAppStore_test.js index 5ed80b061eca..1ad14e01be1f 100644 --- a/browser/components/loop/test/desktop-local/conversationAppStore_test.js +++ b/browser/components/loop/test/desktop-local/conversationAppStore_test.js @@ -250,6 +250,19 @@ describe("loop.store.ConversationAppStore", function () { sinon.assert.notCalled(loop.shared.mixins.WindowCloseMixin.closeWindow); }); + it("should close the window when a room was used and it showed feedback", function() { + store.setStoreState({ + showFeedbackForm: true, + windowType: "room" + }); + roomUsed = true; + + store.LoopHangupNowHandler(); + + sinon.assert.notCalled(dispatcher.dispatch); + sinon.assert.calledOnce(loop.shared.mixins.WindowCloseMixin.closeWindow); + }); + it("should close the window when a room was not used", function() { store.setStoreState({ windowType: "room" });