mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
fix(threads): let administrators grant thread permissions (#3256)
This commit is contained in:
1 parent
d346eb0e88
commit
1997850d55
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -35,7 +35,7 @@ import Users from '@app/features/user/state/Users';
|
|||||||
import * as NicknameUtils from '@app/features/user/utils/NicknameUtils';
|
import * as NicknameUtils from '@app/features/user/utils/NicknameUtils';
|
||||||
import {flip, offset, shift, useClick, useDismiss, useFloating, useInteractions, useRole} from '@floating-ui/react';
|
import {flip, offset, shift, useClick, useDismiss, useFloating, useInteractions, useRole} from '@floating-ui/react';
|
||||||
import {Permissions} from '@fluxer/constants/src/ChannelConstants';
|
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 {msg} from '@lingui/core/macro';
|
||||||
import {Trans, useLingui} from '@lingui/react/macro';
|
import {Trans, useLingui} from '@lingui/react/macro';
|
||||||
import {matchSorter} from 'match-sorter';
|
import {matchSorter} from 'match-sorter';
|
||||||
@@ -117,7 +117,7 @@ const ChannelPermissionsTab: React.FC<{channelId: string}> = observer(({channelI
|
|||||||
}, [isAddOverrideOpen, channelId]);
|
}, [isAddOverrideOpen, channelId]);
|
||||||
const currentUserPermissions = useMemo(() => {
|
const currentUserPermissions = useMemo(() => {
|
||||||
if (!guild || !currentUser || !channel) return 0n;
|
if (!guild || !currentUser || !channel) return 0n;
|
||||||
return PermissionUtils.computePermissions(currentUser.id, channel.toJSON());
|
return withImplicitThreadBits(PermissionUtils.computePermissions(currentUser.id, channel.toJSON()));
|
||||||
}, [guild, currentUser, channel]);
|
}, [guild, currentUser, channel]);
|
||||||
const currentUserMember = useMemo(() => {
|
const currentUserMember = useMemo(() => {
|
||||||
if (!guild || !currentUser) return null;
|
if (!guild || !currentUser) return null;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import MobileLayout from '@app/features/ui/state/MobileLayout';
|
|||||||
import SettingsSidebar from '@app/features/ui/state/SettingsSidebar';
|
import SettingsSidebar from '@app/features/ui/state/SettingsSidebar';
|
||||||
import Users from '@app/features/user/state/Users';
|
import Users from '@app/features/user/state/Users';
|
||||||
import {Permissions} from '@fluxer/constants/src/ChannelConstants';
|
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 {msg} from '@lingui/core/macro';
|
||||||
import {Trans, useLingui} from '@lingui/react/macro';
|
import {Trans, useLingui} from '@lingui/react/macro';
|
||||||
import {matchSorter} from 'match-sorter';
|
import {matchSorter} from 'match-sorter';
|
||||||
@@ -168,7 +168,7 @@ const GuildRolesTab: React.FC<{guildId: string}> = observer(({guildId}) => {
|
|||||||
}, [guild, currentUserMember]);
|
}, [guild, currentUserMember]);
|
||||||
const currentUserPermissions = useMemo(() => {
|
const currentUserPermissions = useMemo(() => {
|
||||||
if (!guild || !currentUser) return 0n;
|
if (!guild || !currentUser) return 0n;
|
||||||
return PermissionUtils.computePermissions(currentUser.id, guild.toJSON());
|
return withImplicitThreadBits(PermissionUtils.computePermissions(currentUser.id, guild.toJSON()));
|
||||||
}, [guild, currentUser]);
|
}, [guild, currentUser]);
|
||||||
const wouldRemoveOwnPermission = useCallback(
|
const wouldRemoveOwnPermission = useCallback(
|
||||||
(permission: bigint, roleId: string): boolean => {
|
(permission: bigint, roleId: string): boolean => {
|
||||||
|
|||||||
Reference in new issue
Block a user