Address warning in Vue 3
Property "unreadMarkerShown" was accessed during render but is not defined on instance
This commit is contained in:
parent
8d8183eabb
commit
8263b17861
@ -63,6 +63,8 @@ import Message from "./Message.vue";
|
|||||||
import MessageCondensed from "./MessageCondensed.vue";
|
import MessageCondensed from "./MessageCondensed.vue";
|
||||||
import DateMarker from "./DateMarker.vue";
|
import DateMarker from "./DateMarker.vue";
|
||||||
|
|
||||||
|
let unreadMarkerShown = false;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MessageList",
|
name: "MessageList",
|
||||||
components: {
|
components: {
|
||||||
@ -183,7 +185,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
beforeUpdate() {
|
beforeUpdate() {
|
||||||
this.unreadMarkerShown = false;
|
unreadMarkerShown = false;
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
eventbus.off("resize", this.handleResize);
|
eventbus.off("resize", this.handleResize);
|
||||||
@ -205,8 +207,8 @@ export default {
|
|||||||
return new Date(previousMessage.time).getDay() !== new Date(message.time).getDay();
|
return new Date(previousMessage.time).getDay() !== new Date(message.time).getDay();
|
||||||
},
|
},
|
||||||
shouldDisplayUnreadMarker(id) {
|
shouldDisplayUnreadMarker(id) {
|
||||||
if (!this.unreadMarkerShown && id > this.channel.firstUnread) {
|
if (!unreadMarkerShown && id > this.channel.firstUnread) {
|
||||||
this.unreadMarkerShown = true;
|
unreadMarkerShown = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user