From 14a9652324a1dbfec55b83ae4fbfb7ee3bf1f3da Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 11 Sep 2014 11:53:37 +0200 Subject: [PATCH] Room topic: if the request fails, show the error in the feedback --- webclient/room/room-controller.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 94c768890..fe3821eb4 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -67,7 +67,14 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) }, updateTopic: function() { console.log("Updating topic to "+$scope.topic.newTopicText); - matrixService.setTopic($scope.room_id, $scope.topic.newTopicText); + matrixService.setTopic($scope.room_id, $scope.topic.newTopicText).then( + function() { + }, + function(error) { + $scope.feedback = "Request failed: " + error.data.error; + } + ); + $scope.topic.isEditing = false; }, cancelEdit: function() {