diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue index 3f77580e9..3c5954233 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue @@ -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', {