fix: throwing error when settings key being empty - fixed #1409

This commit is contained in:
Liyas Thomas
2021-01-04 06:25:02 +05:30
parent eae071f9b8
commit 82de03101b
17 changed files with 27 additions and 20 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -87,7 +87,14 @@
/>
</li>
</ul>
<ul v-if="folder.folders && folder.folders.length === 0 && folder.requests && folder.requests.length === 0">
<ul
v-if="
folder.folders &&
folder.folders.length === 0 &&
folder.requests &&
folder.requests.length === 0
"
>
<li class="flex ml-8 border-l border-brdColor">
<p class="info"><i class="material-icons">not_interested</i> {{ $t("folder_empty") }}</p>
</li>
@@ -124,7 +131,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)))
}

View File

@@ -259,7 +259,7 @@ export default {
this.fileImported()
},
syncToFBCollections() {
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)))
}

View File

@@ -240,7 +240,7 @@ export default {
this.$data.editingRequestIndex = undefined
},
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)))
}

View File

@@ -86,7 +86,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)))
}

View File

@@ -144,7 +144,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)))
}

View File

@@ -50,7 +50,7 @@ export default {
},
methods: {
syncEnvironments() {
if (fb.currentUser !== null) {
if (fb.currentUser !== null && fb.currentSettings[1]) {
if (fb.currentSettings[1].value) {
fb.writeEnvironments(JSON.parse(JSON.stringify(this.$store.state.postwoman.environments)))
}

View File

@@ -135,7 +135,7 @@ export default {
},
methods: {
syncEnvironments() {
if (fb.currentUser !== null) {
if (fb.currentUser !== null && fb.currentSettings[1]) {
if (fb.currentSettings[1].value) {
fb.writeEnvironments(JSON.parse(JSON.stringify(this.$store.state.postwoman.environments)))
}

View File

@@ -51,7 +51,7 @@ export default {
},
methods: {
syncEnvironments() {
if (fb.currentUser !== null) {
if (fb.currentUser !== null && fb.currentSettings[1]) {
if (fb.currentSettings[1].value) {
fb.writeEnvironments(JSON.parse(JSON.stringify(this.$store.state.postwoman.environments)))
}

View File

@@ -256,7 +256,7 @@ export default {
this.fileImported()
},
syncToFBEnvironments() {
if (fb.currentUser !== null) {
if (fb.currentUser !== null && fb.currentSettings[1]) {
if (fb.currentSettings[1].value) {
fb.writeEnvironments(JSON.parse(JSON.stringify(this.$store.state.postwoman.environments)))
}

View File

@@ -153,7 +153,7 @@ export default {
this.$data.editingEnvironmentIndex = undefined
},
syncEnvironments() {
if (fb.currentUser !== null) {
if (fb.currentUser !== null && fb.currentSettings[1]) {
if (fb.currentSettings[1].value) {
fb.writeEnvironments(JSON.parse(JSON.stringify(this.$store.state.postwoman.environments)))
}

View File

@@ -1475,7 +1475,7 @@ export default {
}
this.$refs.historyComponent.addEntry(entry)
if (fb.currentUser !== null) {
if (fb.currentUser !== null && fb.currentSettings[2]) {
if (fb.currentSettings[2].value) {
fb.writeHistory(entry)
}
@@ -1532,7 +1532,7 @@ export default {
}
this.$refs.historyComponent.addEntry(entry)
if (fb.currentUser !== null) {
if (fb.currentUser !== null && fb.currentSettings[2]) {
if (fb.currentSettings[2].value) {
fb.writeHistory(entry)
}

View File

@@ -265,14 +265,14 @@ export default {
setTimeout(() => (target.innerHTML = '<i class="material-icons">clear_all</i>'), 1000)
},
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)))
}
}
},
syncEnvironments() {
if (fb.currentUser !== null) {
if (fb.currentUser !== null && fb.currentSettings[1]) {
if (fb.currentSettings[1].value) {
fb.writeEnvironments(JSON.parse(JSON.stringify(this.$store.state.postwoman.environments)))
}