Fixing bug on request saving

This bug appeared when saving a request with no collections available
This commit is contained in:
adevr
2019-12-08 23:21:53 +00:00
parent cd8b4d0dd1
commit c4bd471516
2 changed files with 50 additions and 3 deletions

View File

@@ -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;
}