Skip to content

Commit

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

[stable27] Fix (visually) removing first notification when executing an action
  • Loading branch information
nickvergessen authored Sep 19, 2023
2 parents 598a5bd + 2f850cc commit 63f0e35
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 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.

Large diffs are not rendered by default.

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 @@ -48,6 +48,10 @@ export default {
default: false,
required: true,
},
notificationIndex: {
type: Number,
required: true,
},
},
data() {
Expand Down Expand Up @@ -118,7 +122,7 @@ export default {
// emit event to current app
this.$parent._$el.fadeOut(OC.menuSpeed)
this.$parent.$emit('remove')
this.$parent.$emit('remove', this.notificationIndex)
emit('notifications:action:executed', event)
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 63f0e35

Please sign in to comment.