Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix dismissing of notifications
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Mar 18, 2019
commit 301563561506ee345ed0be119c23a504e3b4428c
2 changes: 1 addition & 1 deletion js/notifications.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
<div ref="container" class="notification-container">
<div v-if="notifications.length" class="notification-wrapper">
<notification
v-for="n in notifications"
v-for="(n, index) in notifications"
:key="n.notification_id"
v-bind="n"
:index="index"
:notification-id="n.notification_id"
:object-id="n.object_id"
:object-type="n.object_type"
@remove="onRemove" />
<div v-if="notifications.length > 2" class="dismiss-all" @click="onDismissAll">
<span class="icon icon-close svg" :title="t('notifications', 'Dismiss all notifications')" /> {{ t('notifications', 'Dismiss all notifications') }}
Expand Down
16 changes: 11 additions & 5 deletions src/components/Notification.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="notification" :data-id="notification_id" :data-timestamp="timestamp">
<div class="notification" :data-id="notificationId" :data-timestamp="timestamp">
<div class="notification-heading">
<span class="notification-time has-tooltip live-relative-timestamp" :data-timestamp="timestamp" :title="absoluteDate">{{ relativeDate }}</span>
<div class="notification-delete" @click="onDismissNotification">
Expand Down Expand Up @@ -43,8 +43,8 @@ export default {
required: true
},
datetime: {
type: Number,
default: -1,
type: String,
default: '',
required: true
},
app: {
Expand Down Expand Up @@ -117,6 +117,12 @@ export default {
return []
},
required: true
},

index: {
type: Number,
default: -1,
required: true
}
},

Expand Down Expand Up @@ -210,8 +216,8 @@ export default {
axios
.delete(OC.linkToOCS('apps/notifications/api/v2', 2) + 'notifications/' + this.notificationId)
.then(() => {
// this._$el.fadeOut(OC.menuSpeed);
this.$emit('remove')
// this._$el.fadeOut(OC.menuSpeed)
this.$emit('remove', this.index)
})
.catch(() => {
OC.Notification.showTemporary(t('notifications', 'Failed to dismiss notification'))
Expand Down