Skip to content

Commit

Permalink
Fix delete docs not getting deleted immediately
Browse files Browse the repository at this point in the history
Fixed waiting for the wrong non promise objects.
  • Loading branch information
pasin committed May 25, 2016
1 parent d1adc56 commit 4fa765c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/js/stores/DocumentListStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ class DocumentListStore extends Store {
const { curPage, selectedRows } = this.data;
const selectedMap = selectedRows[curPage];

let deleteDocs = Object.keys(selectedMap).map(docId => {
let deleteDocPromises = Object.keys(selectedMap).map(docId => {
const revId = selectedMap[docId];
return deleteDoc(db, docId, revId);
return deleteDoc(db, docId, revId).promise;
});

this._updateDeleteStatus(true);
Promise.all(deleteDocs)
Promise.all(deleteDocPromises)
.then(results => {
this._updateDeleteStatus(false);
this.fetchDocuments(db, 0);
Expand Down

0 comments on commit 4fa765c

Please sign in to comment.