Skip to content

Commit fe6beed

Browse files
committed
fix: fix issue with undefined showing up when adding images to empty post, add new lines between images
1 parent 3d0b59a commit fe6beed

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/layout/Editor.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,10 @@ export default {
313313
if (!url) return
314314
let imageCode = '[img]' + url + '[/img]'
315315
v.preview = false // show compose tab
316-
if (props.threadEditorMode) v.threadCopy.body = v.threadCopy.body + imageCode
317-
else if (props.postEditorMode) v.posting.post.body = v.posting.post.body + imageCode
318-
else if (props.currentMessage) v.newMessage.content.body = v.newMessage.content.body + imageCode
316+
console.log(v.threadCopy, v.posting, v.newMessage)
317+
if (props.threadEditorMode) v.threadCopy.body = `${v.threadCopy.body ? v.threadCopy.body + '\n' : ''}${imageCode}`
318+
else if (props.postEditorMode) v.posting.post.body = `${v.posting?.post?.body ? v.posting.post.body + '\n' : ''}${imageCode}`
319+
else if (props.currentMessage) v.newMessage.content.body = `${v.newMessage?.content?.body ? v.newMessage.content.body + '\n' : ''}${imageCode}`
319320
}
320321
321322
/* View Data */

0 commit comments

Comments
 (0)