mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 09:58:06 +00:00
Handle subscription events in the web client
This has the nice side effect of not requiring us to trigger the events manually in the success callbacks of our subscribe/unsubscribe ajax calls. (imported from commit e8d9970b708e9832d22be4803570071bacb46792)
This commit is contained in:
@@ -675,6 +675,15 @@ function get_updates(options) {
|
||||
}
|
||||
typeahead_helper.autocomplete_needs_update(true);
|
||||
break;
|
||||
case 'subscription':
|
||||
if (event.op === 'add') {
|
||||
$(document).trigger($.Event('subscription_add.zephyr',
|
||||
{subscription: event.subscription}));
|
||||
} else if (event.op === 'remove') {
|
||||
$(document).trigger($.Event('subscription_remove.zephyr',
|
||||
{subscription: event.subscription}));
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user