refactor: separate dialog and edit drafts
This commit is contained in:
parent
7f7eccdd07
commit
b8cadca717
5 changed files with 12 additions and 13 deletions
|
@ -16,7 +16,7 @@ import {
|
|||
<HelpPreview @close="closePreviewHelp()" />
|
||||
</ModalDialog>
|
||||
<ModalDialog v-model="isPublishDialogOpen">
|
||||
<PublishWidget draft-key="dialog" expanded min-w-180 />
|
||||
<PublishWidget :draft-key="dialogDraftKey" expanded min-w-180 />
|
||||
</ModalDialog>
|
||||
<ModalDialog v-model="isImagePreviewDialogOpen">
|
||||
<img :src="imagePreview.src" :alt="imagePreview.alt" max-w-95vw max-h-95vh>
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
function openDialog() {
|
||||
if (dialogDraft.draft.value.editingStatus)
|
||||
openPublishDialog(getDefaultDraft())
|
||||
else openPublishDialog()
|
||||
openPublishDialog()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -102,17 +102,14 @@ const deleteAndRedraft = async () => {
|
|||
// TODO confirm to overwrite
|
||||
}
|
||||
|
||||
openPublishDialog({
|
||||
openPublishDialog('dialog', {
|
||||
params: { ...getParamsFromStatus(status), status: text! },
|
||||
attachments: [],
|
||||
})
|
||||
}
|
||||
|
||||
function editStatus() {
|
||||
if (!dialogDraft.isEmpty) {
|
||||
// TODO confirm to overwrite
|
||||
}
|
||||
openPublishDialog({
|
||||
openPublishDialog(`edit-${status.id}`, {
|
||||
editingStatus: status,
|
||||
params: getParamsFromStatus(status),
|
||||
attachments: [],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue