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

Fixes #336 - stops adding suppressed message defaults

main
Eric Amodio преди 6 години
родител
ревизия
71aace552d
променени са 2 файла, в които са добавени 19 реда и са изтрити 11 реда
  1. +1
    -0
      CHANGELOG.md
  2. +18
    -11
      src/messages.ts

+ 1
- 0
CHANGELOG.md Целия файл

@ -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 Целия файл

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

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