Skip to content

Commit

Permalink
Merge pull request #1664 from nextcloud/backport/1657/stable25-fix-vi…
Browse files Browse the repository at this point in the history
…sually-removing-first-notification-when-executing-an-action

[stable25] Fix (visually) removing first notification when executing an action
  • Loading branch information
nickvergessen authored Sep 19, 2023
2 parents dce0ea7 + f58b7bc commit a299d21
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 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.

6 changes: 5 additions & 1 deletion src/Components/Action.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export default {
default: false,
required: true,
},
notificationIndex: {
type: Number,
required: true,
},
},
data() {
Expand Down Expand Up @@ -79,7 +83,7 @@ export default {
// emit event to current app
this.$parent._$el.fadeOut(OC.menuSpeed)
this.$parent.$emit('remove')
this.$parent.$emit('remove', this.notificationIndex)
try {
$('body').trigger(new $.Event('OCA.Notification.Action', {
notification: this.$parent,
Expand Down
5 changes: 4 additions & 1 deletion src/Components/Notification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@
</div>

<div v-if="actions.length" class="notification-actions">
<Action v-for="(a, i) in actions" :key="i" v-bind="a" />
<Action v-for="(a, i) in actions"
:key="i"
v-bind="a"
:notification-index="index" />
</div>
<div v-else-if="externalLink" class="notification-actions">
<NcButton type="primary"
Expand Down

0 comments on commit a299d21

Please sign in to comment.