diff --git a/components/views/chat/chatbar/Chatbar.html b/components/views/chat/chatbar/Chatbar.html
index 421a427208..b5c6dfcb1f 100644
--- a/components/views/chat/chatbar/Chatbar.html
+++ b/components/views/chat/chatbar/Chatbar.html
@@ -14,7 +14,7 @@
/>
diff --git a/components/views/chat/chatbar/Chatbar.vue b/components/views/chat/chatbar/Chatbar.vue
index 8c87133c60..556d90c0f9 100644
--- a/components/views/chat/chatbar/Chatbar.vue
+++ b/components/views/chat/chatbar/Chatbar.vue
@@ -32,6 +32,7 @@ declare module 'vue/types/vue' {
clearChatbar: Function
handleChatBorderRadius: Function
files: UploadDropItemType[]
+ onRecipientChangeResetUploadState: Function
}
}
export default Vue.extend({
@@ -155,9 +156,9 @@ export default Vue.extend({
deep: true,
},
'recipient.address': {
- handler() {
+ handler(value) {
const findItem = this.chat.chatTexts.find(
- (item: any) => item.userId === this.$props.recipient?.address,
+ (item: any) => item.userId === value,
)
const message = findItem ? findItem.value : ''
this.$refs.editable?.resetHistory()
@@ -171,6 +172,8 @@ export default Vue.extend({
if (this.$device.isDesktop) {
this.$store.dispatch('ui/setChatbarFocus')
}
+
+ this.onRecipientChangeResetUploadState(value)
},
},
},
@@ -380,6 +383,12 @@ export default Vue.extend({
this.$store.commit('chat/setContainsNsfw', false)
this.$store.commit('chat/setCountError', false)
},
+ onRecipientChangeResetUploadState(recipient: string) {
+ this.$data.files = this.getFiles(recipient)
+ this.$store.commit('chat/setContainsNsfw', false)
+ this.$store.commit('chat/setCountError', false)
+ this.$store.commit('chat/setAlertNsfw', false)
+ },
beforeDestroy() {
this.unsubscribe()
},
diff --git a/components/views/files/upload/filePreview/FilePreview.html b/components/views/files/upload/filePreview/FilePreview.html
index d6c31b644e..fd2d77e743 100644
--- a/components/views/files/upload/filePreview/FilePreview.html
+++ b/components/views/files/upload/filePreview/FilePreview.html
@@ -10,7 +10,7 @@