feat: basic alt text edit
This commit is contained in:
parent
0f438b80cd
commit
2f8085fa86
2 changed files with 36 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import type { CreateStatusParams, StatusVisibility } from 'masto'
|
||||
import type { Attachment, CreateStatusParams, StatusVisibility } from 'masto'
|
||||
import { fileOpen } from 'browser-fs-access'
|
||||
import { useDropZone } from '@vueuse/core'
|
||||
import { EditorContent } from '@tiptap/vue-3'
|
||||
|
@ -99,6 +99,11 @@ async function uploadAttachments(files: File[]) {
|
|||
isUploading = false
|
||||
}
|
||||
|
||||
async function setDescription(att: Attachment, description: string) {
|
||||
att.description = description
|
||||
await useMasto().mediaAttachments.update(att.id, { description: att.description })
|
||||
}
|
||||
|
||||
function removeAttachment(index: number) {
|
||||
draft.attachments.splice(index, 1)
|
||||
}
|
||||
|
@ -213,6 +218,7 @@ defineExpose({
|
|||
v-for="(att, idx) in draft.attachments" :key="att.id"
|
||||
:attachment="att"
|
||||
@remove="removeAttachment(idx)"
|
||||
@set-description="setDescription(att, $event)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue