From 4b85c1addab765e2925751438012e3caaa54e8e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 29 Jul 2019 12:01:18 +0200 Subject: [PATCH] Fix iteration over types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- package.json | 2 +- src/components/CollectionList.vue | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 9623a51d..dfa62434 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "license": "AGPL-3.0", "scripts": { "build": "NODE_ENV=production rollup -c", - "watch": "NODE_ENV=production rollup -c --watch", + "watch": "NODE_ENV=development rollup -c --watch", "lint": "eslint --ext .js,.vue src", "lint:fix": "eslint --ext .js,.vue src --fix", "stylelint": "stylelint src", diff --git a/src/components/CollectionList.vue b/src/components/CollectionList.vue index 43faaf23..56854d6b 100644 --- a/src/components/CollectionList.vue +++ b/src/components/CollectionList.vue @@ -219,16 +219,15 @@ export default { }, options() { let options = [] - let types = window.OCP.Collaboration.getTypes().sort() - for (let type in types) { + window.OCP.Collaboration.getTypes().sort().forEach((type) => { options.push({ method: METHOD_CREATE_COLLECTION, - type: types[type], - title: window.OCP.Collaboration.getLabel(types[type]), - class: window.OCP.Collaboration.getIcon(types[type]), - action: () => window.OCP.Collaboration.trigger(types[type]) + type, + title: window.OCP.Collaboration.getLabel(type), + class: window.OCP.Collaboration.getIcon(type), + action: () => window.OCP.Collaboration.trigger(type) }) - } + }) for (let index in this.searchCollections) { if (this.collections.findIndex((collection) => collection.id === this.searchCollections[index].id) === -1) { options.push({