Make announcement close on show

This commit is contained in:
Saoud Rizwan
2024-08-27 21:45:51 -04:00
parent 843ef29a07
commit 083005ecef
3 changed files with 3 additions and 3 deletions

View File

@@ -354,7 +354,7 @@ export class ClaudeDevProvider implements vscode.WebviewViewProvider {
await this.clearTask() await this.clearTask()
await this.postStateToWebview() await this.postStateToWebview()
break break
case "didCloseAnnouncement": case "didShowAnnouncement":
await this.updateGlobalState("lastShownAnnouncementId", this.latestAnnouncementId) await this.updateGlobalState("lastShownAnnouncementId", this.latestAnnouncementId)
await this.postStateToWebview() await this.postStateToWebview()
break break

View File

@@ -10,7 +10,7 @@ export interface WebviewMessage {
| "newTask" | "newTask"
| "askResponse" | "askResponse"
| "clearTask" | "clearTask"
| "didCloseAnnouncement" | "didShowAnnouncement"
| "selectImages" | "selectImages"
| "exportCurrentTask" | "exportCurrentTask"
| "showTaskWithId" | "showTaskWithId"

View File

@@ -28,6 +28,7 @@ const AppContent = () => {
// don't update showAnnouncement to false if shouldShowAnnouncement is false // don't update showAnnouncement to false if shouldShowAnnouncement is false
if (message.state!.shouldShowAnnouncement) { if (message.state!.shouldShowAnnouncement) {
setShowAnnouncement(true) setShowAnnouncement(true)
vscode.postMessage({ type: "didShowAnnouncement" })
} }
break break
case "action": case "action":
@@ -75,7 +76,6 @@ const AppContent = () => {
selectedModelSupportsImages={selectedModelInfo.supportsImages} selectedModelSupportsImages={selectedModelInfo.supportsImages}
selectedModelSupportsPromptCache={selectedModelInfo.supportsPromptCache} selectedModelSupportsPromptCache={selectedModelInfo.supportsPromptCache}
hideAnnouncement={() => { hideAnnouncement={() => {
vscode.postMessage({ type: "didCloseAnnouncement" })
setShowAnnouncement(false) setShowAnnouncement(false)
}} }}
/> />