aboutsummaryrefslogtreecommitdiff
path: root/web/src/app/components
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/app/components')
-rw-r--r--web/src/app/components/Guilds.jsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/web/src/app/components/Guilds.jsx b/web/src/app/components/Guilds.jsx
index 50baa98..38626e4 100644
--- a/web/src/app/components/Guilds.jsx
+++ b/web/src/app/components/Guilds.jsx
@@ -8,18 +8,18 @@ export default async function Guilds({session}) {
});
const guilds = await response.json();
+ const ADMINISTRATOR = 0x0000000000000008;
const MANAGE_GUILD = 0x00000020;
const filteredGuilds = guilds.filter((guild) => {
// Convert permissions string to a BigInt for bitwise operations
const permissions = BigInt(guild.permissions);
- // Check if MANAGE_GUILD bit is set
- return (permissions & BigInt(MANAGE_GUILD)) === BigInt(MANAGE_GUILD);
- });
+ // Check if user is owner, has ADMINISTRATOR or MANAGE_GUILD permissions
+ return guild.owner ||
+ (permissions & BigInt(ADMINISTRATOR)) === BigInt(ADMINISTRATOR) ||
+ (permissions & BigInt(MANAGE_GUILD)) === BigInt(MANAGE_GUILD); });
return filteredGuilds.map((guild) => (
- <div key={guild.id}>
- <h2>{guild.name}</h2>
- </div>
+ <div key={guild.id} className="p-1">{guild.name}</div>
))
}