mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
stream settings: Don't show never subscribed private stream's preview-link.
For public stream, always show stream preview link. For private stream, only show stream preview link if user is currently subscribed or previously subscribed to private stream.
This commit is contained in:
@@ -487,10 +487,11 @@ exports.get_streams_for_admin = function () {
|
||||
};
|
||||
|
||||
exports.initialize_from_page_params = function () {
|
||||
function populate_subscriptions(subs, subscribed) {
|
||||
function populate_subscriptions(subs, subscribed, previously_subscribed) {
|
||||
subs.forEach(function (sub) {
|
||||
var stream_name = sub.name;
|
||||
sub.subscribed = subscribed;
|
||||
sub.previously_subscribed = previously_subscribed;
|
||||
|
||||
exports.create_sub_from_server_data(stream_name, sub);
|
||||
});
|
||||
@@ -498,9 +499,9 @@ exports.initialize_from_page_params = function () {
|
||||
|
||||
exports.set_realm_default_streams(page_params.realm_default_streams);
|
||||
|
||||
populate_subscriptions(page_params.subscriptions, true);
|
||||
populate_subscriptions(page_params.unsubscribed, false);
|
||||
populate_subscriptions(page_params.never_subscribed, false);
|
||||
populate_subscriptions(page_params.subscriptions, true, true);
|
||||
populate_subscriptions(page_params.unsubscribed, false, true);
|
||||
populate_subscriptions(page_params.never_subscribed, false, false);
|
||||
|
||||
// Migrate the notifications stream from the new API structure to
|
||||
// what the frontend expects.
|
||||
|
||||
Reference in New Issue
Block a user