onReply show only latest messages and remove previous conversation
This commit is contained in:
parent
d721ff6cd3
commit
82dfdf6ed3
1 changed files with 11 additions and 1 deletions
|
|
@ -137,7 +137,7 @@
|
|||
<div v-if="replyToEvent" class="row">
|
||||
<div class="col">
|
||||
<div class="font-weight-medium">{{ $t("message.replying_to", { user: replyToEvent.sender.name }) }}</div>
|
||||
<div v-if="replyToContentType === 'm.text'" class="reply-text" :title="replyToEvent.getContent().body"> {{ replyToEvent.getContent().body }} </div>
|
||||
<div v-if="replyToContentType === 'm.text'" class="reply-text" :title="replyToEvent.getContent().body"> {{ replyToEvent.getContent().body | latestReply }} </div>
|
||||
<div v-if="replyToContentType === 'm.image'"> {{ $t("message.reply_image") }} </div>
|
||||
<div v-if="replyToContentType === 'm.audio'"> {{ $t("message.reply_audio_message") }} </div>
|
||||
<div v-if="replyToContentType === 'm.video'"> {{ $t("message.reply_video") }} </div>
|
||||
|
|
@ -643,6 +643,16 @@ export default {
|
|||
};
|
||||
},
|
||||
|
||||
filters: {
|
||||
latestReply(contents) {
|
||||
const contentArr = contents.split('\n').reverse();
|
||||
if (contentArr[0] === '') {
|
||||
contentArr.shift();
|
||||
}
|
||||
return contentArr[0].replace(/^> (<.*> )?/g, '');
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
const container = this.$refs.chatContainer;
|
||||
this.scrollPosition = new ScrollPosition(container);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue