Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions js/notifications-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/notifications-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default {
return this.backgroundFetching
&& this.webNotificationsGranted
&& this.userStatus !== 'dnd'
&& this.tabId !== this.lastTabId
&& this.tabId === this.lastTabId
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

due to this.lastTabId = response.lastTabId in the second part of the diff in this file, we always compared <tabid> !== undefined which was always true and therefor multiple tabs gave multiple desktop notifications again.

},
},

Expand Down Expand Up @@ -275,7 +275,7 @@ export default {
} else if (response.status === 200) {
this.userStatus = response.headers['x-nextcloud-user-status']
this.lastETag = response.headers.etag
this.lastTabId = response.lastTabId
this.lastTabId = response.tabId
this.notifications = response.data
this._setPollingInterval(this.pollIntervalBase)
this._updateDocTitleOnNewNotifications(this.notifications)
Expand Down
4 changes: 4 additions & 0 deletions src/Components/Notification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ export default {
this._$el = $(this.$el)

// Parents: TransitionGroup > NotificationsList
if (typeof this.$parent.$parent.showBrowserNotifications === 'undefined') {
console.error('Failed to read showBrowserNotifications property from App component')
}

if (this.$parent.$parent.showBrowserNotifications) {
this._createWebNotification()
}
Expand Down