Added create collection and save request syncs
This commit is contained in:
@@ -43,6 +43,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { fb } from "../../functions/fb";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
show: Boolean
|
show: Boolean
|
||||||
@@ -56,6 +58,15 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
syncCollections() {
|
||||||
|
if (fb.currentUser !== null) {
|
||||||
|
if (fb.currentSettings[0].value) {
|
||||||
|
fb.writeCollections(
|
||||||
|
JSON.parse(JSON.stringify(this.$store.state.postwoman.collections))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
addNewCollection() {
|
addNewCollection() {
|
||||||
if (!this.$data.name) {
|
if (!this.$data.name) {
|
||||||
this.$toast.info($t("invalid_collection_name"));
|
this.$toast.info($t("invalid_collection_name"));
|
||||||
@@ -65,6 +76,7 @@ export default {
|
|||||||
name: this.$data.name
|
name: this.$data.name
|
||||||
});
|
});
|
||||||
this.$emit("hide-modal");
|
this.$emit("hide-modal");
|
||||||
|
this.syncCollections();
|
||||||
},
|
},
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.$emit("hide-modal");
|
this.$emit("hide-modal");
|
||||||
|
|||||||
@@ -104,6 +104,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { fb } from "../../functions/fb";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
@@ -180,6 +182,15 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
syncCollections() {
|
||||||
|
if (fb.currentUser !== null) {
|
||||||
|
if (fb.currentSettings[0].value) {
|
||||||
|
fb.writeCollections(
|
||||||
|
JSON.parse(JSON.stringify(this.$store.state.postwoman.collections))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
saveRequestAs() {
|
saveRequestAs() {
|
||||||
const userDidntSpecifyCollection =
|
const userDidntSpecifyCollection =
|
||||||
this.$data.requestData.collectionIndex === undefined;
|
this.$data.requestData.collectionIndex === undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user