Skip to content

Commit

Permalink
[developer-options] fix staff tag getting applied to other users
Browse files Browse the repository at this point in the history
  • Loading branch information
ioj4 committed Feb 5, 2025
1 parent 4f352bf commit cfb3ba1
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions plugins/developer-options/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,12 @@ function modifyFlags(flags, isStaff) {

function interceptHandler(dispatch) {
if (
dispatch?.type !== "CONNECTION_OPEN" &&
dispatch?.type !== "USER_UPDATE"
dispatch?.type !== "CONNECTION_OPEN" ||
dispatch?.user?.flags === undefined
)
return;

if (dispatch?.user?.flags !== undefined) {
// CONNECTION_OPEN
dispatch.user.flags = modifyFlags(dispatch.user.flags, true);
} else if (dispatch?.flags !== undefined) {
// USER_UPDATE
dispatch.flags = modifyFlags(dispatch.flags, true);
}
dispatch.user.flags = modifyFlags(dispatch.user.flags, true);

return dispatch;
}
Expand Down

0 comments on commit cfb3ba1

Please sign in to comment.