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

39 lines
787 B
JavaScript
Raw Normal View History

2026-06-03 02:19:25 +03:00
import { defineAsyncComponent } from 'vue'
2023-03-10 12:10:39 -05:00
import Draft from 'src/components/draft/draft.vue'
import List from 'src/components/list/list.vue'
const Drafts = {
components: {
Draft,
2026-01-06 16:22:52 +02:00
List,
2026-06-03 02:19:25 +03:00
ConfirmModal: defineAsyncComponent(
() => import('src/components/confirm_modal/confirm_modal.vue'),
),
},
data() {
return {
2026-05-13 16:12:52 +03:00
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() {
2026-05-13 16:12:52 +03:00
this.$store
.dispatch('abandonAllDrafts')
.then(() => this.hideConfirmDialog())
},
hideConfirmDialog() {
this.showingConfirmDialog = false
},
2026-05-13 16:12:52 +03:00
},
2023-03-10 12:10:39 -05:00
}
export default Drafts