From a6694f7723604c81a3a050e43901fe2726545ea9 Mon Sep 17 00:00:00 2001
From: Bubka <858858+Bubka@users.noreply.github.com>
Date: Tue, 1 Dec 2020 07:03:28 +0100
Subject: [PATCH] Fix #14 : Cache is not refreshed automatically after group
changes
---
resources/js/views/Accounts.vue | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/resources/js/views/Accounts.vue b/resources/js/views/Accounts.vue
index 84b60b87..4f16e2c9 100644
--- a/resources/js/views/Accounts.vue
+++ b/resources/js/views/Accounts.vue
@@ -334,7 +334,7 @@
/**
* Fetch accounts from db
*/
- fetchAccounts() {
+ fetchAccounts(forceRefresh = false) {
let accounts = []
this.selectedAccounts = []
@@ -350,7 +350,7 @@
})
})
- if ( this.accounts.length > 0 && !objectEquals(accounts, this.accounts) ) {
+ if ( this.accounts.length > 0 && !objectEquals(accounts, this.accounts) && !forceRefresh ) {
this.$notify({ type: 'is-dark', text: '' + this.$t('commons.some_data_have_changed') + '
' + this.$t('commons.reload') + '', duration:-1, closeOnClick: false })
}
else if( this.accounts.length === 0 && accounts.length === 0 ) {
@@ -407,7 +407,7 @@
// we fetch the accounts again to prevent the js collection being
// desynchronize from the backend php collection
- this.fetchAccounts()
+ this.fetchAccounts(true)
}
},
@@ -424,7 +424,7 @@
// we fetch the accounts again to prevent the js collection being
// desynchronize from the backend php collection
- this.fetchAccounts()
+ this.fetchAccounts(true)
this.fetchGroups()
this.showGroupSelector = false