Merge pull request #510 from liyasthomas/hotfix/validate-collections
Validate duplicate collections
This commit is contained in:
commit
b60bc1ee39
1 changed files with 6 additions and 0 deletions
|
|
@ -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: [],
|
||||
|
|
|
|||
Loading…
Reference in a new issue