Fix warnings for protobuf object literals (#3948)
Create protobuf objects with .create()
This commit is contained in:
1 parent
89f35b0800
commit
f7e5398ac8
30 files changed
+99
-96
No files matched your search
@@ -47,10 +47,10 @@ export async function deleteNonFavoritedTasks(
|
||||
console.error("Error posting to webview:", webviewErr)
|
||||
}
|
||||
|
||||
return {
|
||||
return DeleteNonFavoritedTasksResults.create({
|
||||
tasksPreserved: favoritedTasks.length,
|
||||
tasksDeleted: deletedCount,
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.error("Error in deleteNonFavoritedTasks:", error)
|
||||
throw error
|
||||
|
||||
@@ -106,10 +106,10 @@ export async function getTaskHistory(controller: Controller, request: GetTaskHis
|
||||
cacheReads: item.cacheReads || 0,
|
||||
}))
|
||||
|
||||
return {
|
||||
return TaskHistoryArray.create({
|
||||
tasks,
|
||||
totalCount,
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.error("Error in getTaskHistory:", error)
|
||||
throw error
|
||||
|
||||
@@ -28,7 +28,7 @@ export async function showTaskWithId(controller: Controller, request: StringRequ
|
||||
})
|
||||
|
||||
// Return task data for gRPC response
|
||||
return {
|
||||
return TaskResponse.create({
|
||||
id: historyItem.id,
|
||||
task: historyItem.task || "",
|
||||
ts: historyItem.ts || 0,
|
||||
@@ -39,7 +39,7 @@ export async function showTaskWithId(controller: Controller, request: StringRequ
|
||||
tokensOut: historyItem.tokensOut || 0,
|
||||
cacheWrites: historyItem.cacheWrites || 0,
|
||||
cacheReads: historyItem.cacheReads || 0,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// If not in global state, fetch from storage
|
||||
@@ -54,7 +54,7 @@ export async function showTaskWithId(controller: Controller, request: StringRequ
|
||||
action: "chatButtonClicked",
|
||||
})
|
||||
|
||||
return {
|
||||
return TaskResponse.create({
|
||||
id: fetchedItem.id,
|
||||
task: fetchedItem.task || "",
|
||||
ts: fetchedItem.ts || 0,
|
||||
@@ -65,7 +65,7 @@ export async function showTaskWithId(controller: Controller, request: StringRequ
|
||||
tokensOut: fetchedItem.tokensOut || 0,
|
||||
cacheWrites: fetchedItem.cacheWrites || 0,
|
||||
cacheReads: fetchedItem.cacheReads || 0,
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.error("Error in showTaskWithId:", error)
|
||||
throw error
|
||||
|
||||
@@ -6,7 +6,7 @@ export async function toggleTaskFavorite(controller: Controller, request: TaskFa
|
||||
if (!request.taskId || request.isFavorited === undefined) {
|
||||
const errorMsg = `[toggleTaskFavorite] Invalid request: taskId or isFavorited missing`
|
||||
console.error(errorMsg)
|
||||
return {}
|
||||
return Empty.create({})
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -47,5 +47,5 @@ export async function toggleTaskFavorite(controller: Controller, request: TaskFa
|
||||
console.error("Error in toggleTaskFavorite:", error)
|
||||
}
|
||||
|
||||
return {}
|
||||
return Empty.create({})
|
||||
}
|
||||
Reference in new issue
Block a user