refactor and rename variable
This commit is contained in:
parent
2874c3a0db
commit
d66d700c73
1 changed files with 5 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue