ReactionRoles: only clear pendingRoleChanges for a member after their roles have been applied

This commit is contained in:
Dragory 2020-06-04 21:41:35 +03:00
parent cc69bc5be4
commit ff4c934ca3
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -189,8 +189,6 @@ export class ReactionRolesPlugin extends ZeppelinPlugin<TConfigSchema> {
timeout: null, timeout: null,
changes: [], changes: [],
applyFn: async () => { applyFn: async () => {
this.pendingRoleChanges.delete(memberId);
const lock = await this.locks.acquire(`member-roles-${memberId}`); const lock = await this.locks.acquire(`member-roles-${memberId}`);
const member = await this.getMember(memberId); const member = await this.getMember(memberId);
@ -212,6 +210,7 @@ export class ReactionRolesPlugin extends ZeppelinPlugin<TConfigSchema> {
} }
} }
this.pendingRoleChanges.delete(memberId);
lock.unlock(); lock.unlock();
}, },
}; };