mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	data export: Fix success banner not clearing.
There was a bug where the success banner stuck around even after the export completed. We now nicely fade and remove the banner upon a successful population of the export in the table. Fixes: #13045
This commit is contained in:
		@@ -60,6 +60,7 @@ set_global('settings_exports', {
 | 
			
		||||
    populate_exports_table: function (exports) {
 | 
			
		||||
        return exports;
 | 
			
		||||
    },
 | 
			
		||||
    clear_success_banner: noop,
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
// page_params is highly coupled to dispatching now
 | 
			
		||||
 
 | 
			
		||||
@@ -512,6 +512,7 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
 | 
			
		||||
        break;
 | 
			
		||||
    case 'realm_export':
 | 
			
		||||
        settings_exports.populate_exports_table(event.exports);
 | 
			
		||||
        settings_exports.clear_success_banner();
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -12,6 +12,18 @@ exports.reset = function () {
 | 
			
		||||
    meta.loaded = false;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
exports.clear_success_banner = function () {
 | 
			
		||||
    var export_status = $('#export_status');
 | 
			
		||||
    if (export_status.hasClass('alert-success')) {
 | 
			
		||||
        // Politely remove our success banner if the export
 | 
			
		||||
        // finishes before the view is closed.
 | 
			
		||||
        export_status.fadeTo(200, 0);
 | 
			
		||||
        setTimeout(function () {
 | 
			
		||||
            export_status.hide();
 | 
			
		||||
        }, 205);
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
exports.populate_exports_table = function (exports) {
 | 
			
		||||
    if (!meta.loaded) {
 | 
			
		||||
        return;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user