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

Commit

Permalink
Bug 1105176 - When leaving a room, the feedback screen will be shown …
Browse files Browse the repository at this point in the history
…to the user
  • Loading branch information
jaoo committed Dec 10, 2014
1 parent dcd4ea3 commit 111bf58
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions app/js/helpers/room/room_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@
});
}

function askForAndSendFeedback(params) {
Loader.getFeedback(false /*isAttention = false*/).then(
function(FeedbackScreen){
FeedbackScreen.show(function(feedback) {
if (!feedback) {
return;
}
LazyLoader.load([
'js/helpers/metrics.js',
'js/helpers/feedback.js'
], function() {
// TODO How should we distinguish between calls and room chats?
Feedback.send(feedback);
});
});
});
}
function removeMyselfFromRoom(params) {
Rooms.get(params.token).then(
function(room) {
Expand Down Expand Up @@ -114,6 +131,8 @@
return;
}

var shouldAskForAndSendFeedback = false;

RoomUI.show(params);

isConnected = true;
Expand Down Expand Up @@ -150,6 +169,7 @@
debug && console.log('Room participant joined');

RoomUI.setConnected();
shouldAskForAndSendFeedback = true;
},
participantVideoAdded: function(event) {
RoomUI.showRemoteVideo(true);
Expand Down Expand Up @@ -183,6 +203,8 @@
roomManager.leave();
isConnected = false;
currentToken = null;

shouldAskForAndSendFeedback && askForAndSendFeedback();
};

RoomUI.onToggleMic = function() {
Expand Down

0 comments on commit 111bf58

Please sign in to comment.