Add subscribe button in narrowed view when stream has no messages.

A temporary message appears on successful subscription, with a button
offering to unsubscribe in case the user subscribed by accident.
This commit is contained in:
Kartik Maji
2016-03-22 21:20:09 +05:30
committed by Tim Abbott
parent 206452c867
commit 3d77aa49db
8 changed files with 56 additions and 15 deletions

View File

@@ -512,7 +512,16 @@ MessageListView.prototype = {
if (last_message_group !== undefined) {
list.last_message_historical = _.last(last_message_group.message_containers).msg.historical;
}
list.update_trailing_bookend();
var stream_name = narrow.stream();
if (stream_name !== undefined) {
// If user narrows to a stream, doesn't update
// trailing bookend if user is subscribed.
var sub = stream_data.get_sub(stream_name);
if (!sub.subscribed) {
list.update_trailing_bookend();
}
}
if (list === current_msg_list) {
// Update the fade.