Display a 'Set Topic' button if there is no topic or it's a 0-len string.

This commit is contained in:
Kegan Dougal 2014-09-08 18:59:26 -07:00
parent 6bdb23449a
commit e8f19b4c0d
3 changed files with 30 additions and 11 deletions

View file

@ -51,7 +51,14 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
console.log("Warning: Already editing topic.");
return;
}
$scope.topic.newTopicText = $rootScope.events.rooms[$scope.room_id]['m.room.topic'].content.topic;
var topicEvent = $rootScope.events.rooms[$scope.room_id]['m.room.topic'];
if (topicEvent) {
$scope.topic.newTopicText = topicEvent.content.topic;
}
else {
$scope.topic.newTopicText = "";
}
$scope.topic.isEditing = true;
},
updateTopic: function() {