🐛 Fixed issues with sync, squashed a bug introduced in last transpile

This commit is contained in:
Liyas Thomas
2020-06-15 15:03:31 +05:30
parent 5249e4730d
commit 5cdc30b822
8 changed files with 61 additions and 14 deletions

View File

@@ -64,6 +64,14 @@ export default {
collectionIndex: this.$props.collectionIndex,
})
this.hideModal()
this.syncCollections()
},
syncCollections() {
if (fb.currentUser !== null) {
if (fb.currentSettings[0].value) {
fb.writeCollections(JSON.parse(JSON.stringify(this.$store.state.postwoman.collections)))
}
}
},
hideModal() {
this.$emit("hide-modal")

View File

@@ -122,6 +122,7 @@ export default {
}
this.$store.commit("postwoman/importCollections", collections)
this.fileImported()
this.syncToFBCollections()
}
reader.readAsText(this.$refs.inputChooseFileToReplaceWith.files[0])
},
@@ -142,6 +143,7 @@ export default {
}
this.$store.commit("postwoman/importCollections", collections)
this.fileImported()
this.syncToFBCollections()
}
reader.readAsText(this.$refs.inputChooseFileToImportFrom.files[0])
},
@@ -167,6 +169,13 @@ export default {
this.$store.commit("postwoman/replaceCollections", fb.currentCollections)
this.fileImported()
},
syncToFBCollections() {
if (fb.currentUser !== null) {
if (fb.currentSettings[0].value) {
fb.writeCollections(JSON.parse(JSON.stringify(this.$store.state.postwoman.collections)))
}
}
},
fileImported() {
this.$toast.info(this.$t("file_imported"), {
icon: "folder_shared",

View File

@@ -84,8 +84,8 @@ export default {
this.syncEnvironments()
},
hideModal() {
this.$data.name = undefined
this.$emit("hide-modal")
this.$data.name = undefined
},
},
}

View File

@@ -135,7 +135,7 @@ export default {
}
},
watch: {
editingEnvironment: function(update) {
editingEnvironment: function (update) {
this.name =
this.$props.editingEnvironment && this.$props.editingEnvironment.name
? this.$props.editingEnvironment.name
@@ -210,8 +210,8 @@ export default {
this.syncEnvironments()
},
hideModal() {
this.$data.name = undefined
this.$emit("hide-modal")
this.$data.name = undefined
},
},
}

View File

@@ -168,10 +168,18 @@ export default {
this.$store.commit("postwoman/replaceEnvironments", fb.currentEnvironments)
this.fileImported()
},
syncToFBEnvironments() {
if (fb.currentUser !== null) {
if (fb.currentSettings[1].value) {
fb.writeEnvironments(JSON.parse(JSON.stringify(this.$store.state.postwoman.environments)))
}
}
},
fileImported() {
this.$toast.info(this.$t("file_imported"), {
icon: "folder_shared",
})
this.syncToFBEnvironments()
},
},
}