Kaynağa Gözat

Fixes #336 - stops adding suppressed message defaults

main
Eric Amodio 6 yıl önce
ebeveyn
işleme
71aace552d
2 değiştirilmiş dosya ile 19 ekleme ve 11 silme
  1. +1
    -0
      CHANGELOG.md
  2. +18
    -11
      src/messages.ts

+ 1
- 0
CHANGELOG.md Dosyayı Görüntüle

@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#345](https://github.com/eamodio/vscode-gitlens/issues/345) - Custom date formats don't work in the GitLens view
- Fixes [#336](https://github.com/eamodio/vscode-gitlens/issues/336) - Default Settings Get Added Automatically
- Fixes issue where username and/or password in a remote urls could be shown
## [8.2.1] - 2018-04-11

+ 18
- 11
src/messages.ts Dosyayı Görüntüle

@ -32,14 +32,10 @@ export class Messages {
}
static async showKeyBindingsInfoMessage(): Promise<MessageItem | undefined> {
const section = configuration.name('advanced')('messages').value;
const messages: { [key: string]: boolean } = configuration.get<{}>(section);
if (messages[SuppressedMessages.ShowKeyBindingsNotice]) return undefined;
if (Container.config.advanced.messages.suppressShowKeyBindingsNotice) return undefined;
if (Container.config.keymap !== KeyMap.Alternate) {
messages[SuppressedMessages.ShowKeyBindingsNotice] = true;
await configuration.update(section, messages, ConfigurationTarget.Global);
await this.suppressedMessage(SuppressedMessages.ShowKeyBindingsNotice);
return undefined;
}
@ -115,11 +111,7 @@ export class Messages {
if (dontShowAgain === null || result === dontShowAgain) {
Logger.log(`ShowMessage(${type}, '${message}', ${suppressionKey}, ${dontShowAgain}) don't show again requested`);
const section = configuration.name('advanced')('messages').value;
const messages: { [key: string]: boolean } = configuration.get<{}>(section);
messages[suppressionKey] = true;
await configuration.update(section, messages, ConfigurationTarget.Global);
await this.suppressedMessage(suppressionKey);
if (result === dontShowAgain) return undefined;
}
@ -127,4 +119,19 @@ export class Messages {
Logger.log(`ShowMessage(${type}, '${message}', ${suppressionKey}, ${dontShowAgain}) returned ${result ? result.title : result}`);
return result;
}
private static suppressedMessage(suppressionKey: SuppressedMessages) {
const section = configuration.name('advanced')('messages').value;
const messages: { [key: string]: boolean | undefined } = configuration.get<{}>(section);
messages[suppressionKey] = true;
for (const [key, value] of Object.entries(messages)) {
if (value !== true) {
messages[key] = undefined;
}
}
return configuration.update(section, messages, ConfigurationTarget.Global);
}
}

Yükleniyor…
İptal
Kaydet