Changesets · Branches · Tags · Compare
| Changeset | ece2990dc0911bd504178a6c3be1eb9177df5f6e4f9bec33261a45e14679cc32 |
|---|---|
| Author | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-25 09:54 +05:30 |
| Committer | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-25 09:54 +05:30 |
| Parents | a367fdbffe58 |
1 file changed
modified extensions/cli/src/ui/components/ToolPermissionSelector.tsx +5 −6
| @@ -64,13 +64,12 @@ | ||
| 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 | + const [initialHasShownDangerousCommand] = useState( | |
| 68 | + hasShownDangerousCommandWarning, | |
| 69 | + ); | |
| 70 | + hasShownDangerousCommandWarning = false; | |
| 72 | 71 | const showDynamicWarning = |
| 73 | - hasDynamicEvaluation && !hasShownDangerousCommandWarningOnce; | |
| 72 | + hasDynamicEvaluation && !initialHasShownDangerousCommand; | |
| 74 | 73 | |
| 75 | 74 | useInput((input, key) => { |
| 76 | 75 | if (key.return) { |