Commit 4aba22a9 authored by Vladimir Baranov's avatar Vladimir Baranov

rref #5392. Remove channel from list after deletion

parent e718c1fc
......@@ -184,7 +184,9 @@ angular.module("ulakbus.messaging")
case '_zops_delete_channel':
iScope.deleteConfirmation('Kanalı silmek istediğinize emin misiniz?')
.then(function(){
MessagingService.delete_channel(getKey(channel));
MessagingService.delete_channel(getKey(channel)).then(function(){
iScope.selectedChannel = null;
});
});
break;
......
......@@ -275,6 +275,9 @@ angular.module('ulakbus.messaging', ['ui.bootstrap'])
};
return wsRequest(outgoing).then(function(result){
$log.info("Channel ", channelKey, " deleted: ", result);
if (channelsMap[channelKey]){
channelsMap[channelKey].deleted = true;
}
return result;
})
};
......
......@@ -11,12 +11,12 @@
<ul class="channels">
<li class="title">KANALLAR <span class="add-action glyphicon glyphicon-plus-sign" ng-click="createChannel()"></span></li>
<li ng-class="{'unread': ch.unread, 'public-ro-channel': ch.read_only, 'active': isChannelSelected(ch)}" title="{{ch.description}}" ng-repeat="ch in publicChannels" ng-click="selectChannel(ch)">{{ch.name}}</li>
<li ng-class="{'unread': ch.unread, 'public-ro-channel': ch.read_only, 'active': isChannelSelected(ch)}" title="{{ch.description}}" ng-repeat="ch in publicChannels" ng-click="selectChannel(ch)" ng-hide="ch.deleted">{{ch.name}}</li>
</ul>
<ul class="direct-messages">
<li class="title">MESAJLAR <span class="add-action glyphicon glyphicon-plus-sign" ng-click="searchUser()"></span></li>
<li ng-class="{'unread': userChannel.unread, 'active': isChannelSelected(userChannel), 'online': userChannel.is_online}" ng-repeat="userChannel in directChannels" ng-click="selectChannel(userChannel)">{{userChannel.name}}</li>
<li ng-class="{'unread': userChannel.unread, 'active': isChannelSelected(userChannel), 'online': userChannel.is_online}" ng-repeat="userChannel in directChannels" ng-click="selectChannel(userChannel)" ng-hide="userChannel.deleted">{{userChannel.name}}</li>
</ul>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment