Quellcode durchsuchen

Adds prompt if patches setting is disabled on show

main
Eric Amodio vor 1 Jahr
Ursprung
Commit
08f673ec22
1 geänderte Dateien mit 17 neuen und 1 gelöschten Zeilen
  1. +17
    -1
      src/plus/drafts/actions.ts

+ 17
- 1
src/plus/drafts/actions.ts Datei anzeigen

@ -1,10 +1,26 @@
import type { MessageItem } from 'vscode';
import { window } from 'vscode';
import { Container } from '../../container';
import { configuration } from '../../system/configuration';
import type { WebviewViewShowOptions } from '../../webviews/webviewsController';
import type { ShowCreateDraft, ShowViewDraft } from '../webviews/patchDetails/registration';
type ShowCreateOrOpen = ShowCreateDraft | ShowViewDraft;
export function showPatchesView(createOrOpen: ShowCreateOrOpen, options?: WebviewViewShowOptions): Promise<void> {
export async function showPatchesView(createOrOpen: ShowCreateOrOpen, options?: WebviewViewShowOptions): Promise<void> {
const confirm: MessageItem = { title: 'Enable' };
const cancel: MessageItem = { title: 'Cancel', isCloseAffordance: true };
const result = await window.showInformationMessage(
'Cloud Patches are currently disabled. Would you like to enable them?',
{ modal: true },
confirm,
cancel,
);
if (result !== confirm) return;
await configuration.updateEffective('cloudPatches.enabled', true);
if (createOrOpen.mode === 'create') {
options = { ...options, preserveFocus: false, preserveVisibility: false };
}

Laden…
Abbrechen
Speichern