Skip to content

Commit 4640048

Browse files
Merge pull request #912 from nextcloud/backport/909/stable20
[stable20] Only send desktop notifications in one tab
2 parents bcefdd7 + 47b2d4e commit 4640048

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

js/notifications-main.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/notifications-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export default {
109109
return this.backgroundFetching
110110
&& this.webNotificationsGranted
111111
&& this.userStatus !== 'dnd'
112-
&& this.tabId !== this.lastTabId
112+
&& this.tabId === this.lastTabId
113113
},
114114
},
115115
@@ -230,7 +230,7 @@ export default {
230230
} else if (response.status === 200) {
231231
this.userStatus = response.headers['x-nextcloud-user-status']
232232
this.lastETag = response.headers.etag
233-
this.lastTabId = response.lastTabId
233+
this.lastTabId = response.tabId
234234
this.notifications = response.data
235235
this._setPollingInterval(30000)
236236
} else if (response.status === 304) {

src/Components/Notification.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ export default {
209209
this._$el = $(this.$el)
210210
211211
// Parents: TransitionGroup > NotificationsList
212+
if (typeof this.$parent.$parent.showBrowserNotifications === 'undefined') {
213+
console.error('Failed to read showBrowserNotifications property from App component')
214+
}
215+
212216
if (this.$parent.$parent.showBrowserNotifications) {
213217
this._createWebNotification()
214218
}

0 commit comments

Comments
 (0)