* refactor out apiconfig section * add general settings section * duplicate import * move terminal, browser, and feature settings * move files to sections folder * refactor out debug section * pull out about section * implement save on change and remove confirmation modals for api config section * add doc strings to new hook functions * add debounced text field for smooth typing * use context value directly for apiProvider dropdown value; remove unecessary memo; remove keys from ApiOptions * add welcomeViewCompleted state boolean to control welcome view showing * refactor other sections to save-on-change; remove form diff calculation logic * cleanup * remove memo * make welcomeViewCompleted context value initial value false
26 lines
955 B
TypeScript
26 lines
955 B
TypeScript
import type { BooleanRequest } from "../../../shared/proto/common"
|
|
import { Empty } from "../../../shared/proto/common"
|
|
import type { Controller } from "../index"
|
|
import { updateGlobalState } from "../../storage/state"
|
|
|
|
/**
|
|
* Sets the welcomeViewCompleted flag to the specified boolean value
|
|
* @param controller The controller instance
|
|
* @param request The boolean request containing the value to set
|
|
* @returns Empty response
|
|
*/
|
|
export async function setWelcomeViewCompleted(controller: Controller, request: BooleanRequest): Promise<Empty> {
|
|
try {
|
|
// Update the global state to set welcomeViewCompleted to the requested value
|
|
await updateGlobalState(controller.context, "welcomeViewCompleted", request.value)
|
|
|
|
await controller.postStateToWebview()
|
|
|
|
console.log(`Welcome view completed set to: ${request.value}`)
|
|
return Empty.create({})
|
|
} catch (error) {
|
|
console.error("Failed to set welcome view completed:", error)
|
|
throw error
|
|
}
|
|
}
|