From 29d5ee54659effd363bbceac06198a6cb478f12c Mon Sep 17 00:00:00 2001 From: suryo12 Date: Sun, 24 May 2026 17:23:27 +0700 Subject: [PATCH] fix(web): remove orphaned hasPermission inline body in roles-manager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- surfsense_web/components/settings/roles-manager.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/surfsense_web/components/settings/roles-manager.tsx b/surfsense_web/components/settings/roles-manager.tsx index 65f47bc43..88595e748 100644 --- a/surfsense_web/components/settings/roles-manager.tsx +++ b/surfsense_web/components/settings/roles-manager.tsx @@ -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()),