Skip to content

Commit e6b991b

Browse files
Only send desktop notifications in one tab
Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
1 parent 4ce61f4 commit e6b991b

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

js/notifications-main.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/notifications-main.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export default {
113113
return this.backgroundFetching
114114
&& this.webNotificationsGranted
115115
&& this.userStatus !== 'dnd'
116-
&& this.tabId !== this.lastTabId
116+
&& this.tabId === this.lastTabId
117117
},
118118
},
119119
@@ -240,7 +240,7 @@ export default {
240240
} else if (response.status === 200) {
241241
this.userStatus = response.headers['x-nextcloud-user-status']
242242
this.lastETag = response.headers.etag
243-
this.lastTabId = response.lastTabId
243+
this.lastTabId = response.tabId
244244
this.notifications = response.data
245245
this._setPollingInterval(this.pollIntervalBase)
246246
} else if (response.status === 304) {

src/Components/Notification.vue

+4
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)