Add progress bar to Community to Space migration tool

and invite-one-by-one to workaround Synapse ratelimits
This commit is contained in:
Michael Telatynski 2021-09-30 13:43:59 +01:00
parent 5eaf0e7e25
commit 8ac77c498f
6 changed files with 78 additions and 15 deletions

View file

@ -62,8 +62,9 @@ export default class MultiInviter {
/**
* @param {string} targetId The ID of the room or group to invite to
* @param {function} progressCallback optional callback, fired after each invite.
*/
constructor(targetId: string) {
constructor(targetId: string, private readonly progressCallback?: () => void) {
if (targetId[0] === '+') {
this.roomId = null;
this.groupId = targetId;
@ -181,6 +182,7 @@ export default class MultiInviter {
delete this.errors[address];
resolve();
this.progressCallback?.();
}).catch((err) => {
if (this.canceled) {
return;