Browse Source

Defers preference loading until needed

main
Eric Amodio 2 years ago
parent
commit
902527b29c
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      src/webviews/commitDetails/commitDetailsWebviewView.ts

+ 10
- 4
src/webviews/commitDetails/commitDetailsWebviewView.ts View File

@ -90,10 +90,7 @@ export class CommitDetailsWebviewView extends WebviewViewBase
this._context = {
pinned: false,
commit: undefined,
preferences: {
autolinksExpanded: this.container.storage.getWorkspace('views:commitDetails:autolinksExpanded'),
filesAsTree: this.container.storage.getWorkspace('views:commitDetails:filesAsTree'),
},
preferences: undefined,
richStateLoaded: false,
formattedMessage: undefined,
autolinkedIssues: undefined,
@ -150,6 +147,15 @@ export class CommitDetailsWebviewView extends WebviewViewBase
}
protected override onInitializing(): Disposable[] | undefined {
if (this._context.preferences == null) {
this.updatePendingContext({
preferences: {
autolinksExpanded: this.container.storage.getWorkspace('views:commitDetails:autolinksExpanded'),
filesAsTree: this.container.storage.getWorkspace('views:commitDetails:filesAsTree'),
},
});
}
if (this._context.commit == null) {
const commit = this.getBestCommitOrStash();
if (commit != null) {

Loading…
Cancel
Save