Skip to content

Commit edbb4bd

Browse files
Merge pull request #242 from RitvikSardana/empty-video-image
fix: video and image controls should not have empty url
2 parents b060fc2 + 8103d33 commit edbb4bd

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/components/TextEditor/InsertImage.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@
2626
/>
2727
</template>
2828
<template #actions>
29-
<Button variant="solid" @click="addImage(addImageDialog.url)">
30-
Insert Image
31-
</Button>
32-
<Button @click="reset"> Cancel </Button>
29+
<div class="flex gap-2">
30+
<Button variant="solid" @click="addImage(addImageDialog.url)">
31+
Insert Image
32+
</Button>
33+
<Button @click="reset"> Cancel </Button>
34+
</div>
3335
</template>
3436
</Dialog>
3537
</template>
@@ -63,6 +65,7 @@ export default {
6365
})
6466
},
6567
addImage(src) {
68+
if (!src) return
6669
this.editor.chain().focus().setImage({ src }).run()
6770
this.reset()
6871
},

src/components/TextEditor/InsertVideo.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export default {
8181
},
8282
8383
addVideo(src) {
84+
if (!src) return
8485
this.editor
8586
.chain()
8687
.focus()

0 commit comments

Comments
 (0)