Skip to content
Snippets Groups Projects
Commit 4b7f6dd7 authored by David Baker's avatar David Baker
Browse files

Only show voice call button if there are exactly 2 members in the room. Also...

Only show voice call button if there are exactly 2 members in the room. Also hide the somewhat user unfriendly call state.
parent 073bec48
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput'])
objDiv.scrollTop = objDiv.scrollHeight;
}, 0);
};
$scope.$on(eventHandlerService.MSG_EVENT, function(ngEvent, event, isLive) {
if (isLive && event.room_id === $scope.room_id) {
scrollToBottom();
......@@ -88,6 +88,10 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput'])
call.onHangup = $scope.onCallHangup;
$scope.currentCall = call;
});
$scope.memberCount = function() {
return Object.keys($scope.members).length;
};
$scope.paginateMore = function() {
if ($scope.state.can_paginate) {
......
......@@ -98,14 +98,14 @@
<button ng-click="inviteUser(userIDToInvite)">Invite</button>
</span>
<button ng-click="leaveRoom()">Leave</button>
<button ng-click="startVoiceCall()" ng-show="currentCall == undefined">Voice Call</button>
<button ng-click="startVoiceCall()" ng-show="currentCall == undefined && memberCount() == 2">Voice Call</button>
<div ng-show="currentCall.state == 'ringing'">
Incoming call from {{ currentCall.user_id }}
<button ng-click="answerCall()">Answer</button>
<button ng-click="hangupCall()">Reject</button>
</div>
<button ng-click="hangupCall()" ng-show="currentCall && currentCall.state != 'ringing'">Hang up</button>
{{ currentCall.state }}
<span style="display: none; ">{{ currentCall.state }}</span>
</div>
{{ feedback }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment