mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 12:16:53 +02:00
Use retry_after_ms instead of hardcoded delay
This commit is contained in:
parent
0f14d89257
commit
c5198418b0
@ -26,9 +26,6 @@ import Promise from "bluebird";
|
||||
import Modal from "../../../../../Modal";
|
||||
import sdk from "../../../../..";
|
||||
|
||||
// Delay between failing invite acceptance/rejections to avoid rate-limiting
|
||||
const INVITE_MANAGEMENT_DELAY = 10000;
|
||||
|
||||
export class IgnoredUser extends React.Component {
|
||||
static propTypes = {
|
||||
userId: PropTypes.string.isRequired,
|
||||
@ -132,7 +129,7 @@ export default class SecurityUserSettingsTab extends React.Component {
|
||||
if (e.errcode === "M_LIMIT_EXCEEDED") {
|
||||
// Add a delay between each invite change in order to avoid rate
|
||||
// limiting by the server.
|
||||
await Promise.delay(INVITE_MANAGEMENT_DELAY);
|
||||
await Promise.delay(e.retry_after_ms);
|
||||
|
||||
// Redo last action
|
||||
i--;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user