Skip to content

Commit

Permalink
fix: fix issue with undefined showing up when adding images to empty …
Browse files Browse the repository at this point in the history
…post, add new lines between images
  • Loading branch information
akinsey committed Nov 22, 2021
1 parent 3d0b59a commit fe6beed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/layout/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,10 @@ export default {
if (!url) return
let imageCode = '[img]' + url + '[/img]'
v.preview = false // show compose tab
if (props.threadEditorMode) v.threadCopy.body = v.threadCopy.body + imageCode
else if (props.postEditorMode) v.posting.post.body = v.posting.post.body + imageCode
else if (props.currentMessage) v.newMessage.content.body = v.newMessage.content.body + imageCode
console.log(v.threadCopy, v.posting, v.newMessage)
if (props.threadEditorMode) v.threadCopy.body = `${v.threadCopy.body ? v.threadCopy.body + '\n' : ''}${imageCode}`
else if (props.postEditorMode) v.posting.post.body = `${v.posting?.post?.body ? v.posting.post.body + '\n' : ''}${imageCode}`
else if (props.currentMessage) v.newMessage.content.body = `${v.newMessage?.content?.body ? v.newMessage.content.body + '\n' : ''}${imageCode}`
}
/* View Data */
Expand Down

0 comments on commit fe6beed

Please sign in to comment.