forked from FoundKeyGang/FoundKey
parent
31a0afdaab
commit
2701a7e85f
1 changed files with 9 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="mfcuwfyp">
|
<div class="mfcuwfyp">
|
||||||
<x-list class="notifications" :items="items" v-slot="{ item: notification }">
|
<x-list class="notifications" :items="items" v-slot="{ item: notification }">
|
||||||
<x-note v-if="['reply', 'quote', 'mention'].includes(notification.type)" :note="notification.note" :key="notification.id"/>
|
<x-note v-if="['reply', 'quote', 'mention'].includes(notification.type)" :note="notification.note" @updated="noteUpdated(notification.note, $event)" :key="notification.id"/>
|
||||||
<x-notification v-else :notification="notification" :with-time="true" :full="true" class="_panel notification" :key="notification.id"/>
|
<x-notification v-else :notification="notification" :with-time="true" :full="true" class="_panel notification" :key="notification.id"/>
|
||||||
</x-list>
|
</x-list>
|
||||||
|
|
||||||
|
@ -82,6 +82,14 @@ export default Vue.extend({
|
||||||
isRead: document.visibilityState === 'visible'
|
isRead: document.visibilityState === 'visible'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
noteUpdated(oldValue, newValue) {
|
||||||
|
const i = this.items.findIndex(n => n.note === oldValue);
|
||||||
|
Vue.set(this.items, i, {
|
||||||
|
...this.items[i],
|
||||||
|
note: newValue
|
||||||
|
});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue