From a67fa94447d487d2e52de1d647fece3bc1a1e865 Mon Sep 17 00:00:00 2001 From: adb Date: Sun, 4 Apr 2021 01:46:41 +0200 Subject: [PATCH 1/6] sort rooms by latest event and fix scrolling at reloading --- src/views/chat.vue | 2 +- src/views/rooms.vue | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/chat.vue b/src/views/chat.vue index cb11836..10f0fa0 100644 --- a/src/views/chat.vue +++ b/src/views/chat.vue @@ -52,7 +52,7 @@ export default { this.loadingStatus = 'loading ...'; await matrix.client.paginateEventTimeline(this.room.getLiveTimeline(), {backwards: true}) .then(state => this.loadingStatus = state?'load more':false); - this.scroll.setScrollBottom(scrollBottom); + if (this.loadingStatus) this.scroll.setScrollBottom(scrollBottom); }, getUser(userId){ return matrix.client.getUser(userId); diff --git a/src/views/rooms.vue b/src/views/rooms.vue index 74a410e..c3184f7 100644 --- a/src/views/rooms.vue +++ b/src/views/rooms.vue @@ -6,7 +6,11 @@

[chat]

[c]

-
+
Date: Sun, 4 Apr 2021 04:44:24 +0200 Subject: [PATCH 2/6] add matrixUtils --- src/App.vue | 2 +- src/components/chatInformation.vue | 6 ++---- src/components/message.vue | 11 ++++++++--- src/components/roomListElement.vue | 7 ++----- src/components/timeline.vue | 23 +++++++++++++++++------ src/lib/matrixUtils.js | 9 +++++++++ src/views/rooms.vue | 2 +- 7 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 src/lib/matrixUtils.js diff --git a/src/App.vue b/src/App.vue index b7c487e..da08dba 100644 --- a/src/App.vue +++ b/src/App.vue @@ -28,7 +28,7 @@ input{ color: #fff; background-color: #1d1d1d; border-radius: 1.25rem; - border: 1px solid #fff; + border: 0.1rem solid #fff; text-align: center; font-size: 1.1rem; margin: 0.5rem; diff --git a/src/components/chatInformation.vue b/src/components/chatInformation.vue index b2b70f3..43caf80 100644 --- a/src/components/chatInformation.vue +++ b/src/components/chatInformation.vue @@ -23,10 +23,10 @@ @@ -85,7 +98,7 @@ export default { top: 3.5rem; width: 100%; height: calc(100% - 7rem); - .messagesContainer{ + .timelineContainer{ height: 100%; overflow-y: auto; } From 8dd34b58ee14d3dab4daee8c34e48e0998152d7b Mon Sep 17 00:00:00 2001 From: adb Date: Tue, 6 Apr 2021 03:33:20 +0200 Subject: [PATCH 6/6] fix getReplyId --- src/components/message.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/message.vue b/src/components/message.vue index 6919416..5186bf6 100644 --- a/src/components/message.vue +++ b/src/components/message.vue @@ -33,7 +33,8 @@ export default { }, getReplyId(content){ if(!content['m.relates_to']) return undefined; - return content['m.relates_to']['m.in_reply_to'].event_id || undefined; + if(!content['m.relates_to']['m.in_reply_to']) return undefined; + return content['m.relates_to']['m.in_reply_to'].event_id; }, calcUserName, parseMessage