Skip to content

Commit 4f2e264

Browse files
committed
Clean up callback that's called after _migrateUnsentEvents
1 parent 129e833 commit 4f2e264

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/amplitude-client.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,15 @@ AmplitudeClient.prototype._migrateUnsentEvents = function _migrateUnsentEvents(c
254254

255255
if (itemsToSet.length > 0) {
256256
Promise.all(itemsToSet).then(() => {
257-
Promise.all(itemsToRemove).then(cb);
257+
Promise.all(itemsToRemove);
258258
}).catch((err) => {
259259
this.options.onError(err);
260260
});
261-
} else {
262-
cb();
263261
}
264-
} else {
265-
cb();
266262
}
267-
}).catch((err) => {
263+
})
264+
.then(cb)
265+
.catch((err) => {
268266
this.options.onError(err);
269267
});
270268
};

0 commit comments

Comments
 (0)