Allow confirmation on closing edit form

This commit is contained in:
tusooa 2023-04-06 14:25:19 -04:00
parent f2bdc1c563
commit c9cacc32a4
No known key found for this signature in database
GPG Key ID: 42AEC43D48433C51
4 changed files with 10 additions and 1 deletions

View File

@ -12,6 +12,9 @@ const EditStatusForm = {
}
},
methods: {
requestClose () {
this.$refs.postStatusForm.requestClose()
},
doEditStatus ({ status, spoilerText, sensitive, media, contentType, poll }) {
const params = {
store: this.$store,

View File

@ -1,5 +1,6 @@
<template>
<PostStatusForm
ref="postStatusForm"
v-bind="params"
:post-handler="doEditStatus"
:disable-polls="true"

View File

@ -43,6 +43,9 @@ const EditStatusModal = {
},
methods: {
closeModal () {
this.$refs.editStatusForm.requestClose()
},
doCloseModal () {
this.$store.dispatch('closeEditStatusModal')
}
}

View File

@ -9,9 +9,11 @@
{{ $t('post_status.edit_status') }}
</div>
<EditStatusForm
ref="editStatusForm"
class="panel-body"
:params="params"
@posted="closeModal"
@posted="doCloseModal"
@can-close="doCloseModal"
/>
</div>
</Modal>