From 82de03101bf4d0b0b060025e9e1fe50d33bcc16b Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Mon, 4 Jan 2021 06:25:02 +0530 Subject: [PATCH] fix: throwing error when settings key being empty - fixed #1409 --- components/collections/add-collection.vue | 2 +- components/collections/collection.vue | 2 +- components/collections/edit-collection.vue | 2 +- components/collections/edit-folder.vue | 2 +- components/collections/edit-request.vue | 2 +- components/collections/folder.vue | 11 +++++++++-- components/collections/import-export-collections.vue | 2 +- components/collections/index.vue | 2 +- components/collections/request.vue | 2 +- components/collections/save-request-as.vue | 2 +- components/environments/add-environment.vue | 2 +- components/environments/edit-environment.vue | 2 +- components/environments/environment.vue | 2 +- components/environments/import-export-environment.vue | 2 +- components/environments/index.vue | 2 +- pages/index.vue | 4 ++-- pages/settings.vue | 4 ++-- 17 files changed, 27 insertions(+), 20 deletions(-) diff --git a/components/collections/add-collection.vue b/components/collections/add-collection.vue index ec3981562..9956c704b 100644 --- a/components/collections/add-collection.vue +++ b/components/collections/add-collection.vue @@ -50,7 +50,7 @@ export default { }, methods: { syncCollections() { - if (fb.currentUser !== null) { + if (fb.currentUser !== null && fb.currentSettings[0]) { if (fb.currentSettings[0].value) { fb.writeCollections(JSON.parse(JSON.stringify(this.$store.state.postwoman.collections))) } diff --git a/components/collections/collection.vue b/components/collections/collection.vue index c76353a32..268606072 100644 --- a/components/collections/collection.vue +++ b/components/collections/collection.vue @@ -132,7 +132,7 @@ export default { }, methods: { syncCollections() { - if (fb.currentUser !== null) { + if (fb.currentUser !== null && fb.currentSettings[0]) { if (fb.currentSettings[0].value) { fb.writeCollections(JSON.parse(JSON.stringify(this.$store.state.postwoman.collections))) } diff --git a/components/collections/edit-collection.vue b/components/collections/edit-collection.vue index b27df64b1..79144fbe5 100644 --- a/components/collections/edit-collection.vue +++ b/components/collections/edit-collection.vue @@ -52,7 +52,7 @@ export default { }, methods: { syncCollections() { - if (fb.currentUser !== null) { + if (fb.currentUser !== null && fb.currentSettings[0]) { if (fb.currentSettings[0].value) { fb.writeCollections(JSON.parse(JSON.stringify(this.$store.state.postwoman.collections))) } diff --git a/components/collections/edit-folder.vue b/components/collections/edit-folder.vue index cb414790c..a6621b994 100644 --- a/components/collections/edit-folder.vue +++ b/components/collections/edit-folder.vue @@ -53,7 +53,7 @@ export default { }, methods: { syncCollections() { - if (fb.currentUser !== null) { + if (fb.currentUser !== null && fb.currentSettings[0]) { if (fb.currentSettings[0].value) { fb.writeCollections(JSON.parse(JSON.stringify(this.$store.state.postwoman.collections))) } diff --git a/components/collections/edit-request.vue b/components/collections/edit-request.vue index c1bc187b5..2704d6636 100644 --- a/components/collections/edit-request.vue +++ b/components/collections/edit-request.vue @@ -57,7 +57,7 @@ export default { }, methods: { syncCollections() { - if (fb.currentUser !== null) { + if (fb.currentUser !== null && fb.currentSettings[0]) { if (fb.currentSettings[0].value) { fb.writeCollections(JSON.parse(JSON.stringify(this.$store.state.postwoman.collections))) } diff --git a/components/collections/folder.vue b/components/collections/folder.vue index fcdf57d85..293ca62a4 100644 --- a/components/collections/folder.vue +++ b/components/collections/folder.vue @@ -87,7 +87,14 @@ /> -