Merge pull request #568 from liyasthomas/fix/collection-sync

Added create collection and save request syncs
This commit is contained in:
Liyas Thomas 2020-02-13 15:28:31 +05:30 committed by GitHub
commit 9a06b19288
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View file

@ -43,6 +43,8 @@
</template>
<script>
import { fb } from "../../functions/fb";
export default {
props: {
show: Boolean
@ -56,6 +58,15 @@ export default {
};
},
methods: {
syncCollections() {
if (fb.currentUser !== null) {
if (fb.currentSettings[0].value) {
fb.writeCollections(
JSON.parse(JSON.stringify(this.$store.state.postwoman.collections))
);
}
}
},
addNewCollection() {
if (!this.$data.name) {
this.$toast.info($t("invalid_collection_name"));
@ -65,6 +76,7 @@ export default {
name: this.$data.name
});
this.$emit("hide-modal");
this.syncCollections();
},
hideModal() {
this.$emit("hide-modal");

View file

@ -104,6 +104,8 @@
</template>
<script>
import { fb } from "../../functions/fb";
export default {
props: {
show: Boolean,
@ -180,6 +182,15 @@ export default {
}
},
methods: {
syncCollections() {
if (fb.currentUser !== null) {
if (fb.currentSettings[0].value) {
fb.writeCollections(
JSON.parse(JSON.stringify(this.$store.state.postwoman.collections))
);
}
}
},
saveRequestAs() {
const userDidntSpecifyCollection =
this.$data.requestData.collectionIndex === undefined;
@ -204,6 +215,7 @@ export default {
});
this.hideModal();
this.syncCollections();
},
hideModal() {
this.$emit("hide-modal");