Pārlūkot izejas kodu

Adds check for feature flag before prompt

main
Ramin Tadayon pirms 1 gada
vecāks
revīzija
d2808fa251
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 79D60DDE3DFB95F5
1 mainītis faili ar 12 papildinājumiem un 11 dzēšanām
  1. +12
    -11
      src/plus/drafts/actions.ts

+ 12
- 11
src/plus/drafts/actions.ts Parādīt failu

@ -8,18 +8,19 @@ import type { ShowCreateDraft, ShowViewDraft } from '../webviews/patchDetails/re
type ShowCreateOrOpen = ShowCreateDraft | ShowViewDraft;
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 (!configuration.get('cloudPatches.enabled')) {
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 (result !== confirm) return;
await configuration.updateEffective('cloudPatches.enabled', true);
}
if (createOrOpen.mode === 'create') {
options = { ...options, preserveFocus: false, preserveVisibility: false };

Notiek ielāde…
Atcelt
Saglabāt