fix: 通知消息一直未读的情况

This commit is contained in:
kuaifan 2022-07-05 11:33:46 +08:00
parent a13da976ae
commit 277869c9d1
2 changed files with 22 additions and 19 deletions

View File

@ -91,7 +91,28 @@ export default {
}
},
watch: {
source: {
handler() {
this.msgRead();
},
immediate: true,
},
windowActive(active) {
if (active) {
this.msgRead();
}
}
},
methods: {
msgRead() {
if (!this.windowActive) {
return;
}
this.$store.dispatch("dialogMsgRead", this.source);
},
onViewTag() {
this.onViewReply({
msg_id: this.source.id,

View File

@ -190,7 +190,7 @@ export default {
},
computed: {
...mapState(['loads', 'audioPlaying', 'windowActive']),
...mapState(['loads', 'audioPlaying']),
...mapGetters(['isLoad']),
isLoading() {
@ -259,17 +259,6 @@ export default {
},
watch: {
msgData: {
handler() {
this.msgRead();
},
immediate: true,
},
windowActive(active) {
if (active) {
this.msgRead();
}
},
operateAction(val) {
this.operateEnter = false;
if (val) {
@ -285,13 +274,6 @@ export default {
this.$emit("on-longpress", {event, el, msgData: this.msgData})
},
msgRead() {
if (!this.windowActive) {
return;
}
this.$store.dispatch("dialogMsgRead", this.msgData);
},
openReadPercentage() {
if (this.popperLoad > 0) {
return;