3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-18 15:45:03 +00:00

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 2599204b89
commit 0e5cc088d3

View file

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