Преглед на файлове

Adds check for feature flag before prompt

main
Ramin Tadayon преди 1 година
родител
ревизия
d2808fa251
No known key found for this signature in database GPG ключ ID: 79D60DDE3DFB95F5
променени са 1 файла, в които са добавени 12 реда и са изтрити 11 реда
  1. +12
    -11
      src/plus/drafts/actions.ts

+ 12
- 11
src/plus/drafts/actions.ts Целия файл

@ -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 };

Зареждане…
Отказ
Запис