From de644b2a1cc07126eeb09eaec710a65ff56b19ea Mon Sep 17 00:00:00 2001 From: Katrin Yordanova Date: Wed, 5 Apr 2023 14:15:55 +0300 Subject: [PATCH] Fix event fetch issue on calendar refresh --- .../web/compose/src/components/PageBlocks/CalendarBase.vue | 6 +++--- locale/en/corteza-webapp-compose/notification.yaml | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client/web/compose/src/components/PageBlocks/CalendarBase.vue b/client/web/compose/src/components/PageBlocks/CalendarBase.vue index 4adab5179..fc8e26c2c 100644 --- a/client/web/compose/src/components/PageBlocks/CalendarBase.vue +++ b/client/web/compose/src/components/PageBlocks/CalendarBase.vue @@ -352,9 +352,9 @@ export default { refresh () { this.refreshing = true - this.api().refetchEvents().then(() => { - this.key++ - }) + new Promise(resolve => resolve(this.api().refetchEvents())) + .then(() => this.key++) + .catch(() => this.toastErrorHandler(this.$t('notification:page.block.calendar.eventFetchFailed'))) }, }, } diff --git a/locale/en/corteza-webapp-compose/notification.yaml b/locale/en/corteza-webapp-compose/notification.yaml index 64bc217fa..349cb75ae 100644 --- a/locale/en/corteza-webapp-compose/notification.yaml +++ b/locale/en/corteza-webapp-compose/notification.yaml @@ -79,6 +79,9 @@ namespace: imported: Namespace imported importFailed: Namespace failed to import page: + block: + calendar: + eventFetchFailed: Could not fetch list of events createFailed: Could not create a page cloneFailed: Could not clone this page deleteFailed: Could not delete this page