You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
Stop using Bluebird::mapSeries
This commit is contained in:
@@ -1150,7 +1150,7 @@ SyncApi.prototype._processSyncResponse = async function(
|
||||
});
|
||||
|
||||
// Handle joins
|
||||
await Promise.mapSeries(joinRooms, async function(joinObj) {
|
||||
await utils.promiseMapSeries(joinRooms, async function(joinObj) {
|
||||
const room = joinObj.room;
|
||||
const stateEvents = self._mapSyncEventsFormat(joinObj.state, room);
|
||||
const timelineEvents = self._mapSyncEventsFormat(joinObj.timeline, room);
|
||||
@@ -1278,8 +1278,8 @@ SyncApi.prototype._processSyncResponse = async function(
|
||||
}
|
||||
}
|
||||
|
||||
await Promise.mapSeries(stateEvents, processRoomEvent);
|
||||
await Promise.mapSeries(timelineEvents, processRoomEvent);
|
||||
await utils.promiseMapSeries(stateEvents, processRoomEvent);
|
||||
await utils.promiseMapSeries(timelineEvents, processRoomEvent);
|
||||
ephemeralEvents.forEach(function(e) {
|
||||
client.emit("event", e);
|
||||
});
|
||||
|
||||
@@ -731,3 +731,9 @@ module.exports.defer = () => {
|
||||
|
||||
return {resolve, reject, promise};
|
||||
};
|
||||
|
||||
module.exports.promiseMapSeries = async (promises, fn) => {
|
||||
for (const o of await promises) {
|
||||
await fn(await o);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user