From c4bd4715162020baced3527fafa548c67edc7762 Mon Sep 17 00:00:00 2001 From: adevr Date: Sun, 8 Dec 2019 23:21:53 +0000 Subject: [PATCH 1/2] Fixing bug on request saving This bug appeared when saving a request with no collections available --- components/collections/saveRequestAs.vue | 10 +++++- pages/index.vue | 43 ++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/components/collections/saveRequestAs.vue b/components/collections/saveRequestAs.vue index e48f01631..d880933c4 100644 --- a/components/collections/saveRequestAs.vue +++ b/components/collections/saveRequestAs.vue @@ -128,7 +128,11 @@ export default { const userSelectedAnyCollection = this.$data.requestData.collectionIndex !== undefined; if (!userSelectedAnyCollection) return []; - + + const noCollectionAvailable = + this.$store.state.postwoman.collections[this.$data.requestData.collectionIndex] !== undefined; + if (!noCollectionAvailable) return []; + return this.$store.state.postwoman.collections[ this.$data.requestData.collectionIndex ].folders; @@ -151,6 +155,10 @@ export default { const collection = this.$store.state.postwoman.collections[ this.$data.requestData.collectionIndex ]; + const noCollectionAvailable = + this.$store.state.postwoman.collections[this.$data.requestData.collectionIndex] !== undefined; + if (!noCollectionAvailable) return []; + const requests = collection.requests; return requests; } diff --git a/pages/index.vue b/pages/index.vue index f8e69737a..a417b0a1e 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -44,7 +44,17 @@