mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-11 23:54:43 +08:00
Implement automatic check for new notifications [SCI-8654] (#5631)
This commit is contained in:
parent
b9ec8ecc08
commit
051e686787
1 changed files with 5 additions and 0 deletions
|
@ -126,6 +126,9 @@
|
|||
// Track name update in user profile settings
|
||||
$(document).on('inlineEditing::updated', '.inline-editing-container[data-field-to-update="full_name"]', this.fetchData);
|
||||
},
|
||||
beforeDestroy: function(){
|
||||
clearTimeout(this.unseenNotificationsTimeout);
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
$.get(this.url, (result) => {
|
||||
|
@ -160,8 +163,10 @@
|
|||
window.open(`${this.searchUrl}?q=${e.target.value}`, '_self')
|
||||
},
|
||||
checkUnseenNotifications() {
|
||||
clearTimeout(this.unseenNotificationsTimeout);
|
||||
$.get(this.unseenNotificationsUrl, (result) => {
|
||||
this.unseenNotificationsCount = result.unseen;
|
||||
this.unseenNotificationsTimeout = setTimeout(this.checkUnseenNotifications, 30000);
|
||||
})
|
||||
},
|
||||
refreshCurrentTeam() {
|
||||
|
|
Loading…
Add table
Reference in a new issue