Fix codacy warnings

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-06-14 11:54:38 +02:00
parent 22190b90cf
commit 06ea03689b
5 changed files with 8 additions and 6 deletions

View File

@@ -22,6 +22,7 @@
import app from '../app/App.js';
/* global OC oc_requesttoken */
export default class FileService {
constructor ($http, FileUploader, CardService) {
@@ -51,7 +52,7 @@ export default class FileService {
};
this.uploader.uploadItem(fileItem);
};
}
onAfterAddingFile (fileItem) {
// Fetch card details before trying to upload so we can detect filename collisions properly
@@ -87,11 +88,11 @@ export default class FileService {
});
};
}
onSuccessItem(item, response) {
let attachments = this.cardservice.get(item.cardId).attachments;
let index = attachments.indexOf(attachments.find(attachment => attachment.id === response.id));
let index = attachments.indexOf(attachments.find((attachment) => attachment.id === response.id));
if (~index) {
attachments = attachments.splice(index, 1);
}