Add 'reset state' debug option; fix kodu login flow after reset state; update Announcement

This commit is contained in:
Saoud Rizwan
2024-08-26 00:21:12 -04:00
parent 2d5c3ad63b
commit 4af5eee2a5
7 changed files with 78 additions and 24 deletions

View File

@@ -11,6 +11,8 @@ import { validateApiConfiguration, validateMaxRequestsPerTask } from "../utils/v
import { vscode } from "../utils/vscode"
import ApiOptions from "./ApiOptions"
const IS_DEV = true
type SettingsViewProps = {
version: string
apiConfiguration?: ApiConfiguration
@@ -79,6 +81,10 @@ const SettingsView = ({
If we only want to run code once on mount we can use react-use's useEffectOnce or useMount
*/
const handleResetState = () => {
vscode.postMessage({ type: "resetState" })
}
return (
<div
style={{
@@ -183,6 +189,23 @@ const SettingsView = ({
)}
</div>
{IS_DEV && (
<>
<div style={{ marginTop: "10px", marginBottom: "4px" }}>Debug</div>
<VSCodeButton onClick={handleResetState} style={{ marginTop: "5px", width: "auto" }}>
Reset State
</VSCodeButton>
<p
style={{
fontSize: "12px",
marginTop: "5px",
color: "var(--vscode-descriptionForeground)",
}}>
This will reset all global state and secret storage in the extension.
</p>
</>
)}
<div
style={{
textAlign: "center",