Elffuss BraidHub

kikocis/continue public

store in state
Changeseta367fdbffe58a04863391778ee965a9bf73707ca66a4ed4d4bba65004105ec3d
Authoruinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-24 19:01 +05:30
Committeruinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-24 19:01 +05:30
Parents8fc76b105504

Browse the files at this changeset

1 file changed

modified extensions/cli/src/ui/components/ToolPermissionSelector.tsx +7 −7
@@ -1,5 +1,5 @@
11 import { Box, Text, useInput } from "ink";
2-import React, { useEffect, useState } from "react";
2+import React, { useState } from "react";
33
44 import { ToolCallTitle } from "src/tools/ToolCallTitle.js";
55
@@ -64,13 +64,13 @@
6464 }) => {
6565 const permissionOptions = getPermissionOptions();
6666 const [selectedIndex, setSelectedIndex] = useState(0);
67+ const [hasShownDangerousCommandWarningOnce] = useState(() => {
68+ const prev = hasShownDangerousCommandWarning;
69+ hasShownDangerousCommandWarning = true;
70+ return prev;
71+ });
6772 const showDynamicWarning =
68- hasDynamicEvaluation && !hasShownDangerousCommandWarning;
69- useEffect(() => {
70- if (showDynamicWarning) {
71- hasShownDangerousCommandWarning = true;
72- }
73- }, [showDynamicWarning]);
73+ hasDynamicEvaluation && !hasShownDangerousCommandWarningOnce;
7474
7575 useInput((input, key) => {
7676 if (key.return) {