fix(web): remove orphaned hasPermission inline body in roles-manager

PR #1428 (issue #1366) extracted the inline `hasPermission` callback into
a shared `canPerform` helper but left the original arrow-function body,
its dependency array, and trailing `)` behind after the new
`useCallback` block. The result was a syntactically invalid statement
that broke `pnpm build` on the `dev` branch and is now blocking every
E2E job in the PR queue.

Delete the orphaned lines so the file parses again. No behavior change —
the working `useCallback(canPerform(access, permission))` already
supplies the same predicate the duplicated body did.
This commit is contained in:
suryo12 2026-05-24 17:23:27 +07:00
parent 63e5943cc8
commit 29d5ee5465

View file

@ -26,7 +26,7 @@ import {
} from "lucide-react";
import { useCallback, useEffect, useMemo, useState } from "react";
import { toast } from "sonner";
import { myAccessAtom, canPerform } from "@/atoms/members/members-query.atoms";
import { canPerform, myAccessAtom } from "@/atoms/members/members-query.atoms";
import { permissionsAtom } from "@/atoms/permissions/permissions-query.atoms";
import {
createRoleMutationAtom,
@ -260,13 +260,6 @@ export function RolesManager({ searchSpaceId }: { searchSpaceId: number }) {
(permission: string) => canPerform(access, permission),
[access]
);
(permission: string) => {
if (!access) return false;
if (access.is_owner) return true;
return access.permissions?.includes(permission) ?? false;
},
[access]
);
const { data: roles = [], isLoading: rolesLoading } = useQuery({
queryKey: cacheKeys.roles.all(searchSpaceId.toString()),