Skip to content

Commit

Permalink
[FIX] Files deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingrub committed Mar 18, 2016
1 parent 8c9e159 commit 34c2f50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/libs/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ function deleteTrack(allTracks, musicFilesFileId) {
for (let i = 0; i < allTracks.length; i++) {
let t = allTracks[i];
if (musicFilesFileId.indexOf(t.get('ressource').fileID) <= -1) {
t.destroy();
t.destroy({ success: () => {
application.allTracks.get('tracks').remove(t);
}});
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/models/track.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Track = Backbone.Model.extend({
break;
case 'delete':
cozysdk.destroy('Track', model.get('_id'), (err, res) => {
if (res) {
if (!err) {
options.success();
}
});
Expand Down

0 comments on commit 34c2f50

Please sign in to comment.