fix(core): fix permissions routing when using remote workspace (#23593)
This commit is contained in:
parent
8cc2c81d57
commit
b5acc2203c
1 changed files with 6 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ import { useSDK } from "../../context/sdk"
|
|||
import { SplitBorder } from "../../component/border"
|
||||
import { useSync } from "../../context/sync"
|
||||
import { useTextareaKeybindings } from "../../component/textarea-keybindings"
|
||||
import { useProject } from "../../context/project"
|
||||
import path from "path"
|
||||
import { LANGUAGE_EXTENSIONS } from "@/lsp/language"
|
||||
import { Keybind } from "@/util"
|
||||
|
|
@ -131,6 +132,7 @@ function TextBody(props: { title: string; description?: string; icon?: string })
|
|||
|
||||
export function PermissionPrompt(props: { request: PermissionRequest }) {
|
||||
const sdk = useSDK()
|
||||
const project = useProject()
|
||||
const sync = useSync()
|
||||
const [store, setStore] = createStore({
|
||||
stage: "permission" as PermissionStage,
|
||||
|
|
@ -187,6 +189,7 @@ export function PermissionPrompt(props: { request: PermissionRequest }) {
|
|||
void sdk.client.permission.reply({
|
||||
reply: "always",
|
||||
requestID: props.request.id,
|
||||
workspace: project.workspace.current(),
|
||||
})
|
||||
}}
|
||||
/>
|
||||
|
|
@ -198,6 +201,7 @@ export function PermissionPrompt(props: { request: PermissionRequest }) {
|
|||
reply: "reject",
|
||||
requestID: props.request.id,
|
||||
message: message || undefined,
|
||||
workspace: project.workspace.current(),
|
||||
})
|
||||
}}
|
||||
onCancel={() => {
|
||||
|
|
@ -450,12 +454,14 @@ export function PermissionPrompt(props: { request: PermissionRequest }) {
|
|||
void sdk.client.permission.reply({
|
||||
reply: "reject",
|
||||
requestID: props.request.id,
|
||||
workspace: project.workspace.current(),
|
||||
})
|
||||
return
|
||||
}
|
||||
void sdk.client.permission.reply({
|
||||
reply: "once",
|
||||
requestID: props.request.id,
|
||||
workspace: project.workspace.current(),
|
||||
})
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue