Add Maestro login button

This commit is contained in:
Saoud Rizwan
2024-08-22 11:02:25 -04:00
parent e8df2400bf
commit f6fd76823b
18 changed files with 375 additions and 11 deletions

View File

@@ -10,6 +10,7 @@ import WelcomeView from "./components/WelcomeView"
import { vscode } from "./utils/vscode"
import HistoryView from "./components/HistoryView"
import { HistoryItem } from "../../src/shared/HistoryItem"
import { MaestroUser } from "../../src/shared/maestro"
/*
The contents of webviews however are created when the webview becomes visible and destroyed when the webview is moved into the background. Any state inside the webview will be lost when the webview is moved to a background tab.
@@ -30,6 +31,7 @@ const App: React.FC = () => {
const [claudeMessages, setClaudeMessages] = useState<ClaudeMessage[]>([])
const [taskHistory, setTaskHistory] = useState<HistoryItem[]>([])
const [showAnnouncement, setShowAnnouncement] = useState(false)
const [maestroUser, setMaestroUser] = useState<MaestroUser | undefined>(undefined)
useEffect(() => {
vscode.postMessage({ type: "webviewDidLaunch" })
@@ -58,6 +60,7 @@ const App: React.FC = () => {
setShowAnnouncement(true)
vscode.postMessage({ type: "didShowAnnouncement" })
}
setMaestroUser(message.state!.maestroUser)
setDidHydrateState(true)
break
case "action":
@@ -100,6 +103,7 @@ const App: React.FC = () => {
<SettingsView
version={version}
apiConfiguration={apiConfiguration}
maestroUser={maestroUser}
setApiConfiguration={setApiConfiguration}
maxRequestsPerTask={maxRequestsPerTask}
setMaxRequestsPerTask={setMaxRequestsPerTask}