Files
716d43a9a8 Nuxt 3 migration (#4342)
Update the nuxt3 version.

Co-authored-by: Jonathan Adeline <jonathan@baserow.io>
Co-authored-by: Bram Wiepjes <bramw@protonmail.com>
Co-authored-by: Cezary <cezary@baserow.io>
Co-authored-by: Tsering Paljor <tsering@baserow.io>
Co-authored-by: Przemyslaw Kukulski <przemyslaw+gh@baserow.io>
Co-authored-by: Bram <bram2w@users.noreply.github.com>
2026-01-22 10:27:19 +01:00

50 lines
976 B
JavaScript

import { notifyIf } from '@baserow/modules/core/utils/error'
export default {
emits: ['click'],
props: {
workspace: {
type: Object,
required: true,
},
notification: {
type: Object,
required: true,
},
},
computed: {
route() {
return this.$registry
.get('notification', this.notification.type)
.getRoute(this.notification.data)
},
sender() {
return this.notification.sender?.first_name
},
},
methods: {
markAsReadAndHandleClick(evt) {
this.$emit('click')
this.markAsRead()
if (typeof this.handleClick === 'function') {
this.handleClick(evt)
}
},
async markAsRead() {
const notification = this.notification
if (notification.read) {
return
}
try {
await this.$store.dispatch('notification/markAsRead', { notification })
} catch (err) {
notifyIf(err, 'error')
}
},
},
}