Skip to content

Commit 1d3710b

Browse files
Merge pull request #2559 from nextcloud/bugfix/469/improve-parallel-feeling
fix(multi-tab): Fix interactions when multiple tabs are active
2 parents 022117d + 29f26b2 commit 1d3710b

11 files changed

Lines changed: 31 additions & 8 deletions

css/NotificationsApp-BPtPFz0N.chunk.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

css/NotificationsApp-DXuAZ_Q5.chunk.css

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

js/NotificationsApp-BSasLk0w.chunk.mjs

Lines changed: 2 additions & 0 deletions
Large diffs are not rendered by default.
File renamed without changes.

js/NotificationsApp-BSasLk0w.chunk.mjs.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

js/NotificationsApp-CnHRKMHH.chunk.mjs

Lines changed: 0 additions & 2 deletions
This file was deleted.

js/NotificationsApp-CnHRKMHH.chunk.mjs.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

js/notifications-main.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('notifications', '', 'js/NotificationsApp-CnHRKMHH.chunk.mjs'),window.OC.filePath('notifications', '', 'js/index-_0iU0BYK-CjtyBpO5.chunk.mjs'),window.OC.filePath('notifications', '', 'js/style-3CHj422B.chunk.mjs'),window.OC.filePath('notifications', '', 'css/style-BhWaMu2d.chunk.css'),window.OC.filePath('notifications', '', 'js/vite-preload-helper-B9rAsR6N.chunk.mjs'),window.OC.filePath('notifications', '', 'css/index-_0iU0BYK-DP1A-Cz8.chunk.css'),window.OC.filePath('notifications', '', 'js/BrowserStorage-FmX8gBxO.chunk.mjs'),window.OC.filePath('notifications', '', 'css/NotificationsApp-BPtPFz0N.chunk.css')])))=>i.map(i=>d[i]);
2-
import{_ as o}from"./vite-preload-helper-B9rAsR6N.chunk.mjs";import{c as t,d as i}from"./style-3CHj422B.chunk.mjs";const m=i(()=>o(()=>import("./NotificationsApp-CnHRKMHH.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url));t(m).mount("#notifications");
1+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('notifications', '', 'js/NotificationsApp-BSasLk0w.chunk.mjs'),window.OC.filePath('notifications', '', 'js/index-_0iU0BYK-CjtyBpO5.chunk.mjs'),window.OC.filePath('notifications', '', 'js/style-3CHj422B.chunk.mjs'),window.OC.filePath('notifications', '', 'css/style-BhWaMu2d.chunk.css'),window.OC.filePath('notifications', '', 'js/vite-preload-helper-B9rAsR6N.chunk.mjs'),window.OC.filePath('notifications', '', 'css/index-_0iU0BYK-DP1A-Cz8.chunk.css'),window.OC.filePath('notifications', '', 'js/BrowserStorage-FmX8gBxO.chunk.mjs'),window.OC.filePath('notifications', '', 'css/NotificationsApp-DXuAZ_Q5.chunk.css')])))=>i.map(i=>d[i]);
2+
import{_ as o}from"./vite-preload-helper-B9rAsR6N.chunk.mjs";import{c as t,d as i}from"./style-3CHj422B.chunk.mjs";const m=i(()=>o(()=>import("./NotificationsApp-BSasLk0w.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url));t(m).mount("#notifications");
33
//# sourceMappingURL=notifications-main.mjs.map

src/NotificationsApp.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ import IconClose from 'vue-material-design-icons/Close.vue'
9696
import IconMessageOutline from 'vue-material-design-icons/MessageOutline.vue'
9797
import IconNotification from './Components/IconNotification.vue'
9898
import NotificationItem from './Components/NotificationItem.vue'
99-
import { getNotificationsData } from './services/notificationsService.js'
99+
import {
100+
getNotificationsData,
101+
setCurrentTabAsActive,
102+
} from './services/notificationsService.js'
100103
import { createWebNotification } from './services/webNotificationsService.js'
101104
102105
const sessionKeepAlive = loadState('core', 'config', { session_keepalive: true }).session_keepalive
@@ -253,8 +256,11 @@ export default {
253256
}
254257
},
255258
256-
onOpen() {
259+
async onOpen() {
257260
this.requestWebNotificationPermissions()
261+
262+
await setCurrentTabAsActive(this.tabId)
263+
await this._fetch()
258264
},
259265
260266
handleNetworkOffline() {
@@ -282,6 +288,8 @@ export default {
282288
.delete(generateOcsUrl('apps/notifications/api/v2/notifications'))
283289
.then(() => {
284290
this.notifications = []
291+
this.open = false
292+
setCurrentTabAsActive(this.tabId)
285293
})
286294
.catch(() => {
287295
showError(t('notifications', 'Failed to dismiss all notifications'))
@@ -290,6 +298,7 @@ export default {
290298
291299
onRemove(index) {
292300
this.notifications.splice(index, 1)
301+
setCurrentTabAsActive(this.tabId)
293302
},
294303
295304
/**

0 commit comments

Comments
 (0)