Changesets · Branches · Tags · Compare
| Changeset | a367fdbffe58a04863391778ee965a9bf73707ca66a4ed4d4bba65004105ec3d |
|---|---|
| Author | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-24 19:01 +05:30 |
| Committer | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-24 19:01 +05:30 |
| Parents | 8fc76b105504 |
1 file changed
modified extensions/cli/src/ui/components/ToolPermissionSelector.tsx +7 −7
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import { Box, Text, useInput } from "ink"; |
| 2 | -import React, { useEffect, useState } from "react"; | |
| 2 | +import React, { useState } from "react"; | |
| 3 | 3 | |
| 4 | 4 | import { ToolCallTitle } from "src/tools/ToolCallTitle.js"; |
| 5 | 5 | |
| @@ -64,13 +64,13 @@ | ||
| 64 | 64 | }) => { |
| 65 | 65 | const permissionOptions = getPermissionOptions(); |
| 66 | 66 | const [selectedIndex, setSelectedIndex] = useState(0); |
| 67 | + const [hasShownDangerousCommandWarningOnce] = useState(() => { | |
| 68 | + const prev = hasShownDangerousCommandWarning; | |
| 69 | + hasShownDangerousCommandWarning = true; | |
| 70 | + return prev; | |
| 71 | + }); | |
| 67 | 72 | const showDynamicWarning = |
| 68 | - hasDynamicEvaluation && !hasShownDangerousCommandWarning; | |
| 69 | - useEffect(() => { | |
| 70 | - if (showDynamicWarning) { | |
| 71 | - hasShownDangerousCommandWarning = true; | |
| 72 | - } | |
| 73 | - }, [showDynamicWarning]); | |
| 73 | + hasDynamicEvaluation && !hasShownDangerousCommandWarningOnce; | |
| 74 | 74 | |
| 75 | 75 | useInput((input, key) => { |
| 76 | 76 | if (key.return) { |