mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-13 00:24:42 +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
|
// Track name update in user profile settings
|
||||||
$(document).on('inlineEditing::updated', '.inline-editing-container[data-field-to-update="full_name"]', this.fetchData);
|
$(document).on('inlineEditing::updated', '.inline-editing-container[data-field-to-update="full_name"]', this.fetchData);
|
||||||
},
|
},
|
||||||
|
beforeDestroy: function(){
|
||||||
|
clearTimeout(this.unseenNotificationsTimeout);
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchData() {
|
fetchData() {
|
||||||
$.get(this.url, (result) => {
|
$.get(this.url, (result) => {
|
||||||
|
@ -160,8 +163,10 @@
|
||||||
window.open(`${this.searchUrl}?q=${e.target.value}`, '_self')
|
window.open(`${this.searchUrl}?q=${e.target.value}`, '_self')
|
||||||
},
|
},
|
||||||
checkUnseenNotifications() {
|
checkUnseenNotifications() {
|
||||||
|
clearTimeout(this.unseenNotificationsTimeout);
|
||||||
$.get(this.unseenNotificationsUrl, (result) => {
|
$.get(this.unseenNotificationsUrl, (result) => {
|
||||||
this.unseenNotificationsCount = result.unseen;
|
this.unseenNotificationsCount = result.unseen;
|
||||||
|
this.unseenNotificationsTimeout = setTimeout(this.checkUnseenNotifications, 30000);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
refreshCurrentTeam() {
|
refreshCurrentTeam() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue