mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix: remove unused props from AIAgentSafetyPopup component
Removes hasSensitiveAction and hasHumanInTheLoop props that were only used by the hook, not the component itself, fixing ESLint unused vars error.
This commit is contained in:
@@ -303,8 +303,6 @@ export function RunAgentModal({
|
||||
|
||||
{/* One-time safety popup for AI-generated agents */}
|
||||
<AIAgentSafetyPopup
|
||||
hasSensitiveAction={agent.has_sensitive_action}
|
||||
hasHumanInTheLoop={agent.has_human_in_the_loop}
|
||||
isOpen={isSafetyPopupOpen}
|
||||
onAcknowledge={handleSafetyPopupAcknowledge}
|
||||
/>
|
||||
|
||||
@@ -8,14 +8,6 @@ import { ShieldCheckIcon } from "@phosphor-icons/react";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
|
||||
interface Props {
|
||||
/**
|
||||
* Whether the agent has sensitive actions that require approval
|
||||
*/
|
||||
hasSensitiveAction: boolean;
|
||||
/**
|
||||
* Whether the agent has human-in-the-loop blocks
|
||||
*/
|
||||
hasHumanInTheLoop: boolean;
|
||||
/**
|
||||
* Called when the user acknowledges the popup
|
||||
*/
|
||||
@@ -30,12 +22,7 @@ interface Props {
|
||||
* One-time safety popup shown the first time a user runs an AI-generated agent
|
||||
* with sensitive actions or human-in-the-loop blocks.
|
||||
*/
|
||||
export function AIAgentSafetyPopup({
|
||||
hasSensitiveAction,
|
||||
hasHumanInTheLoop,
|
||||
onAcknowledge,
|
||||
isOpen,
|
||||
}: Props) {
|
||||
export function AIAgentSafetyPopup({ onAcknowledge, isOpen }: Props) {
|
||||
function handleAcknowledge() {
|
||||
// Mark popup as shown so it won't appear again
|
||||
storage.set(Key.AI_AGENT_SAFETY_POPUP_SHOWN, "true");
|
||||
@@ -106,7 +93,8 @@ export function useAIAgentSafetyPopup(
|
||||
// Only check once after mount (to avoid SSR issues)
|
||||
if (hasChecked) return;
|
||||
|
||||
const hasSeenPopup = storage.get(Key.AI_AGENT_SAFETY_POPUP_SHOWN) === "true";
|
||||
const hasSeenPopup =
|
||||
storage.get(Key.AI_AGENT_SAFETY_POPUP_SHOWN) === "true";
|
||||
const isRelevantAgent = hasSensitiveAction || hasHumanInTheLoop;
|
||||
|
||||
setShouldShowPopup(!hasSeenPopup && isRelevantAgent);
|
||||
|
||||
Reference in New Issue
Block a user