diff --git a/web/src/views/DiscussionsView.vue b/web/src/views/DiscussionsView.vue index b401dcf1..7f74b86f 100644 --- a/web/src/views/DiscussionsView.vue +++ b/web/src/views/DiscussionsView.vue @@ -45,7 +45,7 @@ -
+
@@ -67,7 +67,7 @@
-
@@ -107,6 +107,7 @@ export default { loading: false, filterTitle: "", filterInProgress: false, + isCreated:false } }, methods: { @@ -380,6 +381,7 @@ export default { await this.list_discussions() this.loadLastUsedDiscussion() + this.isCreated=true nextTick(() => { feather.replace() @@ -389,7 +391,18 @@ export default { websocket.on("infos", this.createMsg) websocket.on("message", this.steamMessageContent) - }, components: { + },activated(){ + + // This lifecycle hook runs every time you switch from other page back to this page (vue-router) + // To fix scrolling back to last message, this hook is needed. + // If anyone knows hor to fix scroll issue when changing pages, please do fix it :D + + if(this.isCreated){ + this.loadLastUsedDiscussion() + } + + }, + components: { Discussion, Message, ChatBox, @@ -417,7 +430,7 @@ import WelcomeComponent from '../components/WelcomeComponent.vue' import feather from 'feather-icons' import axios from "axios"; -import { nextTick } from 'vue'; +import { nextTick, onActivated } from 'vue'; import websocket from '@/services/websocket.js';