Prevent newly-created discussions from triggering alert in own browser

This commit is contained in:
Toby Zerner 2015-08-05 19:20:28 +09:30
parent cb2927f317
commit 4b0ffaa64d

View File

@ -84,6 +84,24 @@ app.initializers.add('pusher', () => {
}
});
// Prevent any newly-created discussions from triggering the discussion list
// update button showing.
// TODO: Might be better pause the response to the push updates while the
// composer is loading? idk
extend(DiscussionList.prototype, 'addDiscussion', function(returned, discussion) {
const index = app.pushedUpdates.indexOf(discussion.id());
if (index !== -1) {
app.pushedUpdates.splice(index, 1);
}
if (app.current instanceof IndexPage) {
app.setTitleCount(app.pushedUpdates.length);
}
m.redraw();
});
extend(DiscussionPage.prototype, 'config', function(x, isInitialized, context) {
if (isInitialized) return;