🐛 Hotfix: Broken toast and edit/save operations

This commit is contained in:
Liyas Thomas
2020-03-19 16:18:52 +05:30
parent d95c53bbb6
commit 3b2934d4ae
3 changed files with 4 additions and 6 deletions

View File

@@ -67,7 +67,7 @@ export default {
}, },
addNewCollection() { addNewCollection() {
if (!this.$data.name) { if (!this.$data.name) {
this.$toast.info($t("invalid_collection_name")) this.$toast.info(this.$t("invalid_collection_name"))
return return
} }
this.$store.commit("postwoman/addNewCollection", { this.$store.commit("postwoman/addNewCollection", {

View File

@@ -60,7 +60,7 @@ export default {
methods: { methods: {
saveCollection() { saveCollection() {
if (!this.$data.name) { if (!this.$data.name) {
this.$toast.info($t("invalid_collection_name")) this.$toast.info(this.$t("invalid_collection_name"))
return return
} }
const collectionUpdated = { const collectionUpdated = {

View File

@@ -218,10 +218,8 @@ export const mutations = {
}, },
editCollection({ collections }, payload) { editCollection({ collections }, payload) {
const { const { collection, collectionIndex } = payload
collection: { name }, const { name } = collection
collectionIndex,
} = payload
const duplicateCollection = collections.some( const duplicateCollection = collections.some(
item => item.name.toLowerCase() === name.toLowerCase() item => item.name.toLowerCase() === name.toLowerCase()
) )