Skip to content

Commit

Permalink
Fix losing fileItemUuid when we past new images into message being ed…
Browse files Browse the repository at this point in the history
…ited
  • Loading branch information
nkonev committed Nov 1, 2023
1 parent 395bb01 commit fadac06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/src/MessageEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@
},
onSetMessage(dto) {
this.editMessageDto = dto;
if (hasLength(this.editMessageDto.fileItemUuid)) {
this.$refs.tipTapRef.setFileItemUuid(this.editMessageDto.fileItemUuid)
}
this.saveToStore();
this.setContentToEditorAndLoad();
},
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/TipTapEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ export default {
addText(text) {
this.editor.commands.insertContent(text)
},
setFileItemUuid(fileItemUuid) {
this.preallocatedCandidateFileItemId = fileItemUuid;
},
},
mounted() {
bus.on(PREVIEW_CREATED, this.onPreviewCreated);
Expand Down

0 comments on commit fadac06

Please sign in to comment.