From 3b2934d4ae9f6f2089b4f2ad3cec5f2d70f26cfc Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Thu, 19 Mar 2020 16:18:52 +0530 Subject: [PATCH] :bug: Hotfix: Broken toast and edit/save operations --- components/collections/addCollection.vue | 2 +- components/collections/editCollection.vue | 2 +- store/postwoman.js | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/components/collections/addCollection.vue b/components/collections/addCollection.vue index 878c9d788..518db55d4 100644 --- a/components/collections/addCollection.vue +++ b/components/collections/addCollection.vue @@ -67,7 +67,7 @@ export default { }, addNewCollection() { if (!this.$data.name) { - this.$toast.info($t("invalid_collection_name")) + this.$toast.info(this.$t("invalid_collection_name")) return } this.$store.commit("postwoman/addNewCollection", { diff --git a/components/collections/editCollection.vue b/components/collections/editCollection.vue index 8cfd3f27c..7d7fb4248 100644 --- a/components/collections/editCollection.vue +++ b/components/collections/editCollection.vue @@ -60,7 +60,7 @@ export default { methods: { saveCollection() { if (!this.$data.name) { - this.$toast.info($t("invalid_collection_name")) + this.$toast.info(this.$t("invalid_collection_name")) return } const collectionUpdated = { diff --git a/store/postwoman.js b/store/postwoman.js index 8857ccaba..c9b58d43c 100644 --- a/store/postwoman.js +++ b/store/postwoman.js @@ -218,10 +218,8 @@ export const mutations = { }, editCollection({ collections }, payload) { - const { - collection: { name }, - collectionIndex, - } = payload + const { collection, collectionIndex } = payload + const { name } = collection const duplicateCollection = collections.some( item => item.name.toLowerCase() === name.toLowerCase() )