Skip to content

Commit

Permalink
List Notifications
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Jul 17, 2023
1 parent fd4ca52 commit f4465a9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import Vuex, { Store } from 'vuex'

import storeConfig from './storeConfig.js'

// eslint-disable-next-line n/no-missing-import, import/no-unresolved
import announcementsStore from 'apps/announcementcenter/src/store/announcementsStore.js'

Vue.use(Vuex)

export default new Store(storeConfig)
export default new Store({...storeConfig, ...announcementsStore})
31 changes: 31 additions & 0 deletions src/views/Notifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,37 @@ export default {
this.$store.dispatch('addAnnouncement', announcement)
})
},
/**
* Load the comments of the announcements
*
* @param {number} id the announcement
*/
async onClickAnnouncement(id) {
if (id === this.activeId) {
return
}
this.activeId = id
if (!this.activateAnnouncementHasComments) {
return
}
if (id === 0) {
// Destroy the comments view as the sidebar is destroyed
this.commentsView = null
return
}
if (!this.commentsView) {
// Create a new comments view when there is none
this.commentsView = new OCA.Comments.View('announcement')
}
await this.commentsView.update(id)
this.commentsView.$mount(this.$refs.sidebar)
},
},
}
</script>

0 comments on commit f4465a9

Please sign in to comment.