Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2020-01-06 07:21:07 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2020-01-09 13:03:56 +0300
commite99cbef9e57919e3351ec455f529011e623e9a37 (patch)
treef2de748393dfee318ed6e301ba4ca78775d52095 /src
parent8e4456a6d5665a57a2fdb0ca5091273711a6a9b6 (diff)
Extract function to handle start getting messages preconditions
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/components/MessagesList/MessagesList.vue24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/components/MessagesList/MessagesList.vue b/src/components/MessagesList/MessagesList.vue
index 2381bd809..8f1ac8980 100644
--- a/src/components/MessagesList/MessagesList.vue
+++ b/src/components/MessagesList/MessagesList.vue
@@ -167,23 +167,15 @@ export default {
// is a participant in the old and the new conversation).
token: {
immediate: true,
- handler(token) {
- if (token && this.isParticipant) {
- this.startGettingMessages()
- } else {
- this.cancelLookForNewMessages()
- }
+ handler() {
+ this.handleStartGettingMessagesPreconditions()
},
},
isParticipant: {
immediate: true,
- handler(isParticipant) {
- if (this.token && isParticipant) {
- this.startGettingMessages()
- } else {
- this.cancelLookForNewMessages()
- }
+ handler() {
+ this.handleStartGettingMessagesPreconditions()
},
},
},
@@ -297,6 +289,14 @@ export default {
return moment.unix(message.timestamp)
},
+ handleStartGettingMessagesPreconditions() {
+ if (this.token && this.isParticipant) {
+ this.startGettingMessages()
+ } else {
+ this.cancelLookForNewMessages()
+ }
+ },
+
/**
* Fetches the messages of a conversation given the conversation token. Triggers
* a long-polling request for new messages.