Skip to content

Commit b42b993

Browse files
committed
Reload messages on received
1 parent a0ddd5d commit b42b993

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

web/layouts/default.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ export default class DefaultLayout extends Vue {
5050
channel.bind('phone.updated', () => {
5151
this.canPoll = true
5252
})
53-
channel.bind('message.phone.received', () => {
54-
this.canPoll = true
55-
})
5653
5754
this.startPoller()
5855
}, 10_000) // delay so that the auth user is present
@@ -78,7 +75,6 @@ export default class DefaultLayout extends Vue {
7875
promises.push(
7976
this.$store.dispatch('loadPhones', true),
8077
this.$store.dispatch('loadThreads'),
81-
this.$store.dispatch('loadMessages'),
8278
this.$store.dispatch('getHeartbeat'),
8379
)
8480
}

web/pages/threads/_id/index.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,11 @@ export default Vue.extend({
427427
this.loadMessages(false)
428428
}
429429
})
430+
this.webhookChannel.bind('message.phone.received', () => {
431+
if (!this.loadingMessages) {
432+
this.loadMessages(false)
433+
}
434+
})
430435
},
431436
432437
beforeDestroy() {

0 commit comments

Comments
 (0)