compose: Hide sub-btn in compose-to-unsub warning if user can't subscribe.

Hide subscription button in compose-message-to-unsubscribe-stream
warning, if user can't subscribe back to stream.
This commit is contained in:
Yashashvi Dave
2018-11-01 00:29:40 +05:30
parent 7dc021a6b2
commit f6b4e65b92
3 changed files with 9 additions and 2 deletions

View File

@@ -471,7 +471,9 @@ exports.validation_error = function (error_type, stream_name) {
compose_error(i18n.t("Error checking subscription"), $("#stream"));
return false;
case "not-subscribed":
var new_row = templates.render("compose_not_subscribed");
var sub = stream_data.get_sub(stream_name);
var new_row = templates.render("compose_not_subscribed", {
should_display_sub_button: sub.should_display_subscription_button});
compose_not_subscribed_error(new_row, $('#stream'));
return false;
}