From 1997850d55cee489279dc4c86785afe1e445c0cb Mon Sep 17 00:00:00 2001 From: Hampus Date: Wed, 7 Oct 2026 21:32:39 +0200 Subject: [PATCH] fix(threads): let administrators grant thread permissions (#3256) --- .../components/modals/channel_tabs/ChannelPermissionsTab.tsx | 4 ++-- .../guild/components/modals/guild_tabs/GuildRolesTab.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fluxer_app/src/features/channel/components/modals/channel_tabs/ChannelPermissionsTab.tsx b/fluxer_app/src/features/channel/components/modals/channel_tabs/ChannelPermissionsTab.tsx index 1d6517dad..916db8020 100644 --- a/fluxer_app/src/features/channel/components/modals/channel_tabs/ChannelPermissionsTab.tsx +++ b/fluxer_app/src/features/channel/components/modals/channel_tabs/ChannelPermissionsTab.tsx @@ -35,7 +35,7 @@ import Users from '@app/features/user/state/Users'; import * as NicknameUtils from '@app/features/user/utils/NicknameUtils'; import {flip, offset, shift, useClick, useDismiss, useFloating, useInteractions, useRole} from '@floating-ui/react'; import {Permissions} from '@fluxer/constants/src/ChannelConstants'; -import {THREAD_PERMISSIONS} from '@fluxer/constants/src/ThreadPermissionUtils'; +import {THREAD_PERMISSIONS, withImplicitThreadBits} from '@fluxer/constants/src/ThreadPermissionUtils'; import {msg} from '@lingui/core/macro'; import {Trans, useLingui} from '@lingui/react/macro'; import {matchSorter} from 'match-sorter'; @@ -117,7 +117,7 @@ const ChannelPermissionsTab: React.FC<{channelId: string}> = observer(({channelI }, [isAddOverrideOpen, channelId]); const currentUserPermissions = useMemo(() => { if (!guild || !currentUser || !channel) return 0n; - return PermissionUtils.computePermissions(currentUser.id, channel.toJSON()); + return withImplicitThreadBits(PermissionUtils.computePermissions(currentUser.id, channel.toJSON())); }, [guild, currentUser, channel]); const currentUserMember = useMemo(() => { if (!guild || !currentUser) return null; diff --git a/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildRolesTab.tsx b/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildRolesTab.tsx index 45e9a0869..a836eee2f 100644 --- a/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildRolesTab.tsx +++ b/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildRolesTab.tsx @@ -38,7 +38,7 @@ import MobileLayout from '@app/features/ui/state/MobileLayout'; import SettingsSidebar from '@app/features/ui/state/SettingsSidebar'; import Users from '@app/features/user/state/Users'; import {Permissions} from '@fluxer/constants/src/ChannelConstants'; -import {THREAD_PERMISSIONS} from '@fluxer/constants/src/ThreadPermissionUtils'; +import {THREAD_PERMISSIONS, withImplicitThreadBits} from '@fluxer/constants/src/ThreadPermissionUtils'; import {msg} from '@lingui/core/macro'; import {Trans, useLingui} from '@lingui/react/macro'; import {matchSorter} from 'match-sorter'; @@ -168,7 +168,7 @@ const GuildRolesTab: React.FC<{guildId: string}> = observer(({guildId}) => { }, [guild, currentUserMember]); const currentUserPermissions = useMemo(() => { if (!guild || !currentUser) return 0n; - return PermissionUtils.computePermissions(currentUser.id, guild.toJSON()); + return withImplicitThreadBits(PermissionUtils.computePermissions(currentUser.id, guild.toJSON())); }, [guild, currentUser]); const wouldRemoveOwnPermission = useCallback( (permission: bigint, roleId: string): boolean => {