mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Remove subs.reload_subscriptions().
(imported from commit 72d831101033fb7db4b024781bf597f63345be79)
This commit is contained in:
		@@ -173,10 +173,6 @@ exports.remove_narrow_filter = function (name, type) {
 | 
			
		||||
    get_filter_li(type, name).remove();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
exports.remove_all_narrow_filters = function () {
 | 
			
		||||
    $("#stream_filters").children().remove();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function remove_expanded_subjects() {
 | 
			
		||||
    popovers.hide_topic_sidebar_popover();
 | 
			
		||||
    $("ul.expanded_subjects").remove();
 | 
			
		||||
 
 | 
			
		||||
@@ -357,39 +357,6 @@ function populate_subscriptions(subs, subscribed) {
 | 
			
		||||
    return sub_rows;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exports.reload_subscriptions = function (opts) {
 | 
			
		||||
    var on_success;
 | 
			
		||||
    opts = _.defaults({}, opts, {clear_first: false, custom_callbacks: false});
 | 
			
		||||
 | 
			
		||||
    if (! opts.custom_callbacks) {
 | 
			
		||||
        on_success = function (data) {
 | 
			
		||||
                         if (data) {
 | 
			
		||||
                             populate_subscriptions(data.subscriptions, true);
 | 
			
		||||
                         }
 | 
			
		||||
                     };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (opts.clear_first) {
 | 
			
		||||
        // Only clear the subscriptions just before we're ready to repopulate,
 | 
			
		||||
        // otherwise the stream list will go blank in the UI while we wait for
 | 
			
		||||
        // the network request to finish.
 | 
			
		||||
        var existing_callback = on_success;
 | 
			
		||||
        on_success = function (data) {
 | 
			
		||||
            stream_data.clear_subscriptions();
 | 
			
		||||
            stream_list.remove_all_narrow_filters();
 | 
			
		||||
            existing_callback(data);
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return $.ajax({
 | 
			
		||||
                    type:     'POST',
 | 
			
		||||
                    url:      '/json/subscriptions/list',
 | 
			
		||||
                    dataType: 'json',
 | 
			
		||||
                    timeout:  10*1000,
 | 
			
		||||
                    success: on_success
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
exports.setup_page = function () {
 | 
			
		||||
    util.make_loading_indicator($('#subs_page_loading_indicator'));
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user