diff --git a/lib/persona.js b/lib/persona.js index 6107f7e..11c2c03 100644 --- a/lib/persona.js +++ b/lib/persona.js @@ -70,7 +70,7 @@ $(document).ready(function() { $(window).one('action:taskbar.pushed', function(ev, data) { updateChatCount(data.element); }); - + } else if (!data.element.hasClass('active')) { updateChatCount(data.element); } @@ -121,8 +121,11 @@ $(document).ready(function() { function setupPaginator() { function appendPageNumber(ev, data) { - var el = data.after ? data.after : data.before, - page = Math.ceil((el.attr('data-index') - 1) / config.postsPerPage), + var el = data.after ? data.after : data.before; + if (!el) { + return; + } + var page = Math.ceil((el.attr('data-index') - 1) / config.postsPerPage), handle = $('