Merge pull request #510 from liyasthomas/hotfix/validate-collections

Validate duplicate collections
This commit is contained in:
James George 2020-01-21 20:10:15 +05:30 committed by GitHub
commit b60bc1ee39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,6 +111,12 @@ export const mutations = {
},
addNewCollection({ collections }, collection) {
const { name } = collection
const duplicateCollection = collections.some(item => item.name === name)
if (duplicateCollection) {
this.$toast.info('Duplicate collection');
return;
}
collections.push({
name: "",
folders: [],