Skip to content

Commit cd8c708

Browse files
committed
code cleanup
1 parent 33ffe79 commit cd8c708

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

ui/components/multichain/pages/gator-permissions/components/review-gator-permission-item.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type ReviewGatorPermissionItemProps = {
7777
/**
7878
* Whether this permission has a pending revoke click (temporary UI state)
7979
*/
80-
isPendingRevokeClick?: boolean;
80+
hasRevokeBeenClicked?: boolean;
8181
};
8282

8383
type PermissionExpandedDetails = Record<
@@ -107,7 +107,7 @@ export const ReviewGatorPermissionItem = ({
107107
networkName,
108108
gatorPermission,
109109
onRevokeClick,
110-
isPendingRevokeClick = false,
110+
hasRevokeBeenClicked = false,
111111
}: ReviewGatorPermissionItemProps) => {
112112
const t = useI18nContext();
113113
const { permissionResponse, siteOrigin } = gatorPermission;
@@ -158,12 +158,12 @@ export const ReviewGatorPermissionItem = ({
158158

159159
const isPendingRevocation = useMemo(() => {
160160
return (
161-
isPendingRevokeClick ||
161+
hasRevokeBeenClicked ||
162162
pendingRevocations.some(
163163
(revocation) => revocation.permissionContext === permissionContext,
164164
)
165165
);
166-
}, [pendingRevocations, permissionContext, isPendingRevokeClick]);
166+
}, [pendingRevocations, permissionContext, hasRevokeBeenClicked]);
167167

168168
/**
169169
* Handles the click event for the expand/collapse button

ui/components/multichain/pages/gator-permissions/review-permissions/review-gator-permissions-page.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,6 @@ export const ReviewGatorPermissionsPage = ({
141141
try {
142142
await revokeGatorPermission(permission);
143143

144-
// Clear any existing timeout for this context
145-
const existingTimeout = revokeTimeoutsRef.current.get(context);
146-
clearTimeout(existingTimeout);
147-
revokeTimeoutsRef.current.delete(context);
148-
149144
// Delay clearing to prevent visual flash before transaction window shows
150145
const timeoutId = setTimeout(() => {
151146
removePendingContext(context);
@@ -180,7 +175,7 @@ export const ReviewGatorPermissionsPage = ({
180175
networkName={networkName}
181176
gatorPermission={permission}
182177
onRevokeClick={() => handleRevokeClick(permission)}
183-
isPendingRevokeClick={pendingRevokeClicks.has(
178+
hasRevokeBeenClicked={pendingRevokeClicks.has(
184179
permission.permissionResponse.context,
185180
)}
186181
/>

0 commit comments

Comments
 (0)