refactor and rename variable

This commit is contained in:
uinstinct 2025-09-25 09:54:06 +05:30
parent 2874c3a0db
commit d66d700c73

View file

@ -64,13 +64,12 @@ export const ToolPermissionSelector: React.FC<ToolPermissionSelectorProps> = ({
}) => {
const permissionOptions = getPermissionOptions();
const [selectedIndex, setSelectedIndex] = useState(0);
const [hasShownDangerousCommandWarningOnce] = useState(() => {
const prev = hasShownDangerousCommandWarning;
hasShownDangerousCommandWarning = true;
return prev;
});
const [initialHasShownDangerousCommand] = useState(
hasShownDangerousCommandWarning,
);
hasShownDangerousCommandWarning = false;
const showDynamicWarning =
hasDynamicEvaluation && !hasShownDangerousCommandWarningOnce;
hasDynamicEvaluation && !initialHasShownDangerousCommand;
useInput((input, key) => {
if (key.return) {