Fix persist plugin removing already-granted roles

Specifically, the mute role granted by the mutes plugin.
This commit is contained in:
Dragory 2020-01-20 23:37:29 +02:00
parent 0818b0479b
commit 5bc0f335d2
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -83,7 +83,7 @@ export class PersistPlugin extends ZeppelinPlugin<TConfigSchema> {
const rolesToRestore = intersection(persistedRoles, persistedData.roles);
if (rolesToRestore.length) {
restoredData.push("roles");
toRestore.roles = rolesToRestore;
toRestore.roles = Array.from(new Set([...rolesToRestore, ...member.roles]));
}
}