pleroma-fe/src/components/drafts/drafts.js

39 lines
815 B
JavaScript
Raw Normal View History

2023-03-10 12:10:39 -05:00
import Draft from 'src/components/draft/draft.vue'
import List from 'src/components/list/list.vue'
import ConfirmModal from 'src/components/confirm_modal/confirm_modal.vue'
2023-03-10 12:10:39 -05:00
const Drafts = {
components: {
Draft,
2026-01-06 16:22:52 +02:00
List,
ConfirmModal,
},
data() {
return {
showingConfirmDialog: false
}
2023-03-10 12:10:39 -05:00
},
computed: {
2026-01-06 16:22:52 +02:00
drafts() {
2023-03-10 12:10:39 -05:00
return this.$store.getters.draftsArray
2026-01-06 16:22:52 +02:00
},
},
methods: {
abandonAll() {
this.showingConfirmDialog = true
},
doAbandonAll() {
this.drafts.forEach((draft) => {
this.$store.dispatch('abandonDraft', { id: draft.id }).then(() => {
this.hideConfirmDialog()
})
})
this.hideConfirmDialog()
},
hideConfirmDialog() {
this.showingConfirmDialog = false
},
}
2023-03-10 12:10:39 -05:00
}
export default Drafts