From d24666370f519a3c537d3084e95c9d4e0f479230 Mon Sep 17 00:00:00 2001 From: Edwin Betancourt Date: Mon, 18 May 2020 12:16:20 -0400 Subject: [PATCH] fix: Error with `this.unsubscribe is not a function` (#499) --- src/components/ADempiere/Dashboard/docstatus/index.vue | 3 ++- src/components/ADempiere/Dashboard/recentItems/index.vue | 3 ++- src/components/ADempiere/Dashboard/userfavorites/index.vue | 3 ++- src/components/ADempiere/Form/PriceChecking/index.vue | 3 ++- src/views/ADempiere/Test/index.vue | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/ADempiere/Dashboard/docstatus/index.vue b/src/components/ADempiere/Dashboard/docstatus/index.vue index 9d7f8b0a..0fe3807a 100644 --- a/src/components/ADempiere/Dashboard/docstatus/index.vue +++ b/src/components/ADempiere/Dashboard/docstatus/index.vue @@ -40,6 +40,7 @@ export default { data() { return { documents: [], + unsubscribe: () => {}, search: '' } }, @@ -89,7 +90,7 @@ export default { }) }, subscribeChanges() { - this.$store.subscribe((mutation, state) => { + return this.$store.subscribe((mutation, state) => { if (mutation.type === 'notifyDashboardRefresh') { this.getPendingDocuments() } diff --git a/src/components/ADempiere/Dashboard/recentItems/index.vue b/src/components/ADempiere/Dashboard/recentItems/index.vue index 965e5c29..4fb7801a 100644 --- a/src/components/ADempiere/Dashboard/recentItems/index.vue +++ b/src/components/ADempiere/Dashboard/recentItems/index.vue @@ -49,6 +49,7 @@ export default { data() { return { recentItems: [], + unsubscribe: () => {}, isLoaded: true, search: '', accentRegexp: /[\u0300-\u036f]/g @@ -144,7 +145,7 @@ export default { } }, subscribeChanges() { - this.$store.subscribe((mutation, state) => { + return this.$store.subscribe((mutation, state) => { if (mutation.type === 'notifyDashboardRefresh') { this.getRecentItems() } diff --git a/src/components/ADempiere/Dashboard/userfavorites/index.vue b/src/components/ADempiere/Dashboard/userfavorites/index.vue index 6419009a..00e1d060 100644 --- a/src/components/ADempiere/Dashboard/userfavorites/index.vue +++ b/src/components/ADempiere/Dashboard/userfavorites/index.vue @@ -54,6 +54,7 @@ export default { data() { return { favorites: [], + unsubscribe: () => {}, isLoaded: true, search: '', accentRegexp: /[\u0300-\u036f]/g @@ -108,7 +109,7 @@ export default { }) }, subscribeChanges() { - this.$store.subscribe((mutation, state) => { + return this.$store.subscribe((mutation, state) => { if (mutation.type === 'notifyDashboardRefresh') { this.getFavoritesList() } diff --git a/src/components/ADempiere/Form/PriceChecking/index.vue b/src/components/ADempiere/Form/PriceChecking/index.vue index 9e26626c..c1c806d9 100644 --- a/src/components/ADempiere/Form/PriceChecking/index.vue +++ b/src/components/ADempiere/Form/PriceChecking/index.vue @@ -37,7 +37,8 @@ export default { mixins: [formMixin], data() { return { - fieldsList + fieldsList, + unsubscribe: () => {} } }, created() { diff --git a/src/views/ADempiere/Test/index.vue b/src/views/ADempiere/Test/index.vue index a476ba69..bb574026 100644 --- a/src/views/ADempiere/Test/index.vue +++ b/src/views/ADempiere/Test/index.vue @@ -96,7 +96,8 @@ export default { }, data() { return { - fieldsList + fieldsList, + unsubscribe: () => {} } }, computed: {