From 5bc0f335d259f3ffa2323739c17e30b846257f2d Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Mon, 20 Jan 2020 23:37:29 +0200 Subject: [PATCH] Fix persist plugin removing already-granted roles Specifically, the mute role granted by the mutes plugin. --- backend/src/plugins/Persist.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/plugins/Persist.ts b/backend/src/plugins/Persist.ts index 3a43436c..0232601e 100644 --- a/backend/src/plugins/Persist.ts +++ b/backend/src/plugins/Persist.ts @@ -83,7 +83,7 @@ export class PersistPlugin extends ZeppelinPlugin { const rolesToRestore = intersection(persistedRoles, persistedData.roles); if (rolesToRestore.length) { restoredData.push("roles"); - toRestore.roles = rolesToRestore; + toRestore.roles = Array.from(new Set([...rolesToRestore, ...member.roles])); } }