From a2539c88b6b00a60a6bc37f2636b25efa0b6de7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e?= <tpoussard@neogeo.fr> Date: Mon, 22 Aug 2022 11:48:17 +0200 Subject: [PATCH] prevent fetch features if offline --- src/views/Project/FeaturesListAndMap.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/views/Project/FeaturesListAndMap.vue b/src/views/Project/FeaturesListAndMap.vue index 1846d6f3..1f256e15 100644 --- a/src/views/Project/FeaturesListAndMap.vue +++ b/src/views/Project/FeaturesListAndMap.vue @@ -154,6 +154,9 @@ export default { }, computed: { + ...mapState([ + 'isOnline' + ]), ...mapState('projects', [ 'project', ]), @@ -384,6 +387,7 @@ export default { }, fetchPagedFeatures(newUrl) { + if (!this.isOnline) return; let url = `${this.API_BASE_URL}projects/${this.projectSlug}/feature-paginated/?limit=${this.pagination.pagesize}&offset=${this.pagination.start}`; //* if receiving next & previous url (// todo : might be not used anymore, to check) if (newUrl && typeof newUrl === 'string') { -- GitLab