fix link by calling grpc (#4422)

This commit is contained in:
celestial-vault
2025-06-24 16:07:19 -07:00
committed by GitHub
parent 936923d334
commit 59efda3e22
3 changed files with 30 additions and 9 deletions
+20
View File
@@ -0,0 +1,20 @@
import type { Controller } from "../index"
import type { StringRequest } from "../../../shared/proto/common"
import { Empty } from "../../../shared/proto/common"
import { openUrlInBrowser } from "../../../utils/github-url-utils"
/**
* Opens a URL in the default browser
* @param controller The controller instance
* @param request The URL to open
* @returns Empty response
*/
export async function openUrl(controller: Controller, request: StringRequest): Promise<Empty> {
try {
await openUrlInBrowser(request.value)
return Empty.create({})
} catch (error) {
console.error(`Failed to open URL: ${error}`)
throw error
}
}