Merge pull request #3889 from timmw/timmw/vue3-prep

Changes required for vue 3
This commit is contained in:
Pavel Djundik 2020-04-28 22:10:55 +03:00 committed by GitHub
commit 512fc5ca04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 17 deletions

View file

@ -57,7 +57,6 @@ rules:
yoda: error yoda: error
vue/require-default-prop: off vue/require-default-prop: off
vue/no-v-html: off vue/no-v-html: off
vue/no-use-v-if-with-v-for: off
plugins: plugins:
- vue - vue

View file

@ -64,7 +64,7 @@
<div class="chat"> <div class="chat">
<div class="messages"> <div class="messages">
<div class="msg"> <div class="msg">
<Component <component
:is="specialComponent" :is="specialComponent"
:network="network" :network="network"
:channel="channel" :channel="channel"

View file

@ -19,7 +19,7 @@
</template> </template>
<template v-else-if="isAction()"> <template v-else-if="isAction()">
<span class="from"><span class="only-copy">*** </span></span> <span class="from"><span class="only-copy">*** </span></span>
<Component :is="messageComponent" :network="network" :message="message" /> <component :is="messageComponent" :network="network" :message="message" />
</template> </template>
<template v-else-if="message.type === 'action'"> <template v-else-if="message.type === 'action'">
<span class="from"><span class="only-copy">* </span></span> <span class="from"><span class="only-copy">* </span></span>

View file

@ -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;
} }

View file

@ -106,17 +106,18 @@
@start="onDragStart" @start="onDragStart"
@end="onDragEnd" @end="onDragEnd"
> >
<Channel <template v-for="(channel, index) in network.channels">
v-for="(channel, index) in network.channels" <Channel
v-if="index > 0" v-if="index > 0"
:key="channel.id" :key="channel.id"
:channel="channel" :channel="channel"
:network="network" :network="network"
:active=" :active="
$store.state.activeChannel && $store.state.activeChannel &&
channel === $store.state.activeChannel.channel channel === $store.state.activeChannel.channel
" "
/> />
</template>
</Draggable> </Draggable>
</div> </div>
</Draggable> </Draggable>