Skip to content

Commit 88cc65d

Browse files
committed
fix: ensure delete env message is modal
1 parent 0d28935 commit 88cc65d

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

src/common/window.apis.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {
77
InputBox,
88
InputBoxOptions,
99
LogOutputChannel,
10+
MessageItem,
11+
MessageOptions,
1012
OpenDialogOptions,
1113
OutputChannel,
1214
Progress,
@@ -284,7 +286,19 @@ export async function showInputBoxWithButtons(
284286
}
285287
}
286288

287-
export function showWarningMessage(message: string, ...items: string[]): Thenable<string | undefined> {
289+
export function showWarningMessage<T extends string>(message: string, ...items: T[]): Thenable<T | undefined>;
290+
export function showWarningMessage<T extends string>(
291+
message: string,
292+
options: MessageOptions,
293+
...items: T[]
294+
): Thenable<T | undefined>;
295+
export function showWarningMessage<T extends MessageItem>(message: string, ...items: T[]): Thenable<T | undefined>;
296+
export function showWarningMessage<T extends MessageItem>(
297+
message: string,
298+
options: MessageOptions,
299+
...items: T[]
300+
): Thenable<T | undefined>;
301+
export function showWarningMessage(message: string, ...items: any[]): Thenable<string | undefined> {
288302
return window.showWarningMessage(message, ...items);
289303
}
290304

src/managers/builtin/venvUtils.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,13 @@ export async function removeVenv(environment: PythonEnvironment, log: LogOutputC
459459

460460
const confirm = await showWarningMessage(
461461
l10n.t('Are you sure you want to remove {0}?', envPath),
462-
Common.yes,
463-
Common.no,
462+
{
463+
modal: true,
464+
},
465+
{ title: Common.yes },
466+
{ title: Common.no, isCloseAffordance: true },
464467
);
465-
if (confirm === Common.yes) {
468+
if (confirm?.title === Common.yes) {
466469
await withProgress(
467470
{
468471
location: ProgressLocation.Notification,

0 commit comments

Comments
 (0)