Skip to content

Commit ea3d0d8

Browse files
committed
Hide the auto-approve limit warning once clicked
1 parent 14c7668 commit ea3d0d8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

webview-ui/src/components/chat/AutoApprovedRequestLimitWarning.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { memo } from "react"
1+
import React, { memo, useState } from "react"
22
import { VSCodeButton } from "@vscode/webview-ui-toolkit/react"
33
import { ClineMessage } from "@roo/shared/ExtensionMessage"
44
import { vscode } from "@src/utils/vscode"
@@ -9,7 +9,13 @@ type AutoApprovedRequestLimitWarningProps = {
99
}
1010

1111
export const AutoApprovedRequestLimitWarning = memo(({ message }: AutoApprovedRequestLimitWarningProps) => {
12+
const [buttonClicked, setButtonClicked] = useState(false)
1213
const { count } = JSON.parse(message.text ?? "{}")
14+
15+
if (buttonClicked) {
16+
return null
17+
}
18+
1319
return (
1420
<>
1521
<div style={{ display: "flex", alignItems: "center", gap: "8px", color: "var(--vscode-foreground)" }}>
@@ -35,6 +41,7 @@ export const AutoApprovedRequestLimitWarning = memo(({ message }: AutoApprovedRe
3541
style={{ width: "100%", padding: "6px", borderRadius: "4px" }}
3642
onClick={(e) => {
3743
e.preventDefault()
44+
setButtonClicked(true)
3845
vscode.postMessage({ type: "askResponse", askResponse: "yesButtonClicked" })
3946
}}>
4047
<Trans i18nKey="ask.autoApprovedRequestLimitReached.button" ns="chat" />

0 commit comments

Comments
 (0)