clean up getStateToPostToWebview in preparation for migration to StateManager service (#5266)
This commit is contained in:
1 parent
81564faa4e
commit
8e984f2d98
4 files changed
+44
-26
No files matched your search
@@ -2,6 +2,7 @@ import type { EmptyRequest } from "@shared/proto/cline/common"
|
||||
import { Boolean } from "@shared/proto/cline/common"
|
||||
import type { Controller } from "../index"
|
||||
import { updateGlobalState } from "../../storage/state"
|
||||
import { getLatestAnnouncementId } from "@/extension"
|
||||
|
||||
/**
|
||||
* Marks the current announcement as shown
|
||||
@@ -12,8 +13,9 @@ import { updateGlobalState } from "../../storage/state"
|
||||
*/
|
||||
export async function onDidShowAnnouncement(controller: Controller, _request: EmptyRequest): Promise<Boolean> {
|
||||
try {
|
||||
const latestAnnouncementId = getLatestAnnouncementId(controller.context)
|
||||
// Update the lastShownAnnouncementId to the current latestAnnouncementId
|
||||
await updateGlobalState(controller.context, "lastShownAnnouncementId", controller.latestAnnouncementId)
|
||||
await updateGlobalState(controller.context, "lastShownAnnouncementId", latestAnnouncementId)
|
||||
return Boolean.create({ value: false })
|
||||
} catch (error) {
|
||||
console.error("Failed to acknowledge announcement:", error)
|
||||
|
||||
Reference in new issue
Block a user