Skip to content

Commit

Permalink
Bug: Force fetch inbox settings on route change (chatwoot#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavrajs authored Dec 30, 2019
1 parent bacc0b2 commit 7c4cc68
Showing 1 changed file with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,27 @@ export default {
return createMessengerScript(this.inbox.page_id);
},
},
watch: {
$route(to) {
if (to.name === 'settings_inbox_show') {
this.fetchInboxSettings();
}
},
},
mounted() {
this.$store.dispatch('agents/get');
this.$store.dispatch('inboxes/get').then(() => {
this.fetchAttachedAgents();
});
this.fetchInboxSettings();
},
methods: {
showAlert(message) {
bus.$emit('newToastMessage', message);
},
fetchInboxSettings() {
this.selectedAgents = [];
this.$store.dispatch('agents/get');
this.$store.dispatch('inboxes/get').then(() => {
this.fetchAttachedAgents();
});
},
async fetchAttachedAgents() {
try {
const response = await this.$store.dispatch('inboxMembers/get', {
Expand Down

0 comments on commit 7c4cc68

Please sign in to comment.