瀏覽代碼

Fixes #1351 stops showing whats new more than once

main
Eric Amodio 3 年之前
父節點
當前提交
f2843c771d
共有 1 個檔案被更改,包括 12 行新增4 行删除
  1. +12
    -4
      src/extension.ts

+ 12
- 4
src/extension.ts 查看文件

@ -65,14 +65,22 @@ export async function activate(context: ExtensionContext): Promise
const gitlensVersion = gitlens.packageJSON.version;
const syncedVersion = context.globalState.get<string>(SyncedState.Version);
const previousVersion =
const localVersion =
context.globalState.get<string>(GlobalState.Version) ??
context.globalState.get<string>(GlobalState.Deprecated_Version) ??
syncedVersion;
context.globalState.get<string>(GlobalState.Deprecated_Version);
let previousVersion;
if (localVersion == null || syncedVersion == null) {
previousVersion = syncedVersion ?? localVersion;
} else if (Versions.compare(syncedVersion, localVersion) === 1) {
previousVersion = syncedVersion;
} else {
previousVersion = localVersion;
}
if (Logger.willLog('debug')) {
Logger.debug(
`GitLens (v${gitlensVersion}): syncedVersion=${syncedVersion}, previousVersion=${previousVersion}, ${
`GitLens (v${gitlensVersion}): syncedVersion=${syncedVersion}, localVersion=${localVersion}, previousVersion=${previousVersion}, ${
SyncedState.WelcomeViewVisible
}=${context.globalState.get<boolean>(SyncedState.WelcomeViewVisible)}, ${
SyncedState.UpdatesViewVisible

Loading…
取消
儲存