aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/main.js
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-12-16 13:50:43 +0000
committerMario <mario@mariovavti.com>2019-12-16 13:50:43 +0000
commit230f7ab6d48b6af3bbc41147c3ef753e4d1e3051 (patch)
tree3974d047905e230ebba7414ec2dee55c8fb68e1e /view/js/main.js
parent00f6deb9bd3a372020962c41ca48881540b3c906 (diff)
downloadvolse-hubzilla-230f7ab6d48b6af3bbc41147c3ef753e4d1e3051.tar.gz
volse-hubzilla-230f7ab6d48b6af3bbc41147c3ef753e4d1e3051.tar.bz2
volse-hubzilla-230f7ab6d48b6af3bbc41147c3ef753e4d1e3051.zip
sse: remove redundant code
Diffstat (limited to 'view/js/main.js')
-rw-r--r--view/js/main.js19
1 files changed, 2 insertions, 17 deletions
diff --git a/view/js/main.js b/view/js/main.js
index da1894f88..4ec7a71aa 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -30,7 +30,6 @@ var sse_bs_active = false;
var sse_offset = 0;
var sse_type;
var sse_partial_result = false;
-var sse_mids = [];
// take care of tab/window reloads on channel change
if(localStorage.getItem('uid') !== localUser.toString()) {
@@ -699,14 +698,11 @@ function updateConvItems(mode,data) {
var nmids = $(this).data('b64mids');
nmids.forEach(function(nmid, index) {
- sse_mids.push(nmid);
-
if($('.notification[data-b64mid=\'' + nmid + '\']').length) {
$('.notification[data-b64mid=\'' + nmid + '\']').each(function() {
var n = this.parentElement.id.split('-');
- return sse_updateNotifications(n[1], nmid, true);
+ return sse_updateNotifications(n[1], nmid);
});
- sse_mids = [];
}
// special handling for forum notifications
@@ -1774,16 +1770,10 @@ function sse_handleNotificationsItems(notifyType, data, replace, followup) {
}
$(data).each(function() {
- if(sse_mids.indexOf(this.b64mid) >= 0) {
- return sse_updateNotifications(notifyType, this.b64mid, false);
- }
-
html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.addr,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top,this.unseen,this.private_forum, encodeURIComponent(this.mids));
notify_menu.append(html);
});
- sse_mids = [];
-
if(!replace && !followup) {
$("#nav-" + notifyType + "-menu .notification").sort(function(a,b) {
a = new Date(a.dataset.when);
@@ -1815,9 +1805,7 @@ function sse_handleNotificationsItems(notifyType, data, replace, followup) {
}
}
-function sse_updateNotifications(type, mid, interactive) {
-
- //console.log('interactive: ' + interactive);
+function sse_updateNotifications(type, mid) {
if(type === 'pubs')
return true;
@@ -1839,9 +1827,6 @@ function sse_updateNotifications(type, mid, interactive) {
$('.' + type + '-update').html(count);
}
- if(! interactive)
- return true;
-
$('#nav-' + type + '-menu .notification[data-b64mid=\'' + mid + '\']').fadeOut(function() {
this.remove();
});