Browse Source

Preserves autolinks state per-workspace

main
Eric Amodio 2 years ago
parent
commit
b810ebdd3c
2 changed files with 8 additions and 3 deletions
  1. +3
    -1
      src/storage.ts
  2. +5
    -2
      src/webviews/commitDetails/commitDetailsWebviewView.ts

+ 3
- 1
src/storage.ts View File

@ -164,7 +164,6 @@ export interface GlobalStorage {
visible?: boolean; visible?: boolean;
}; };
commitDetails: { commitDetails: {
autolinksExpanded?: boolean;
dismissed?: string[]; dismissed?: string[];
}; };
}; };
@ -202,6 +201,9 @@ export interface WorkspaceStorage {
keepResults?: boolean; keepResults?: boolean;
pinned?: StoredPinnedItems; pinned?: StoredPinnedItems;
}; };
commitDetails: {
autolinksExpanded?: boolean;
};
}; };
pinned: { pinned: {

+ 5
- 2
src/webviews/commitDetails/commitDetailsWebviewView.ts View File

@ -150,7 +150,7 @@ export class CommitDetailsWebviewView extends WebviewViewBase
if (this._context.preferences == null) { if (this._context.preferences == null) {
this.updatePendingContext({ this.updatePendingContext({
preferences: { preferences: {
autolinksExpanded: this.container.storage.get('views:commitDetails:autolinksExpanded'),
autolinksExpanded: this.container.storage.getWorkspace('views:commitDetails:autolinksExpanded'),
avatars: configuration.get('views.commitDetails.avatars'), avatars: configuration.get('views.commitDetails.avatars'),
dismissed: this.container.storage.get('views:commitDetails:dismissed'), dismissed: this.container.storage.get('views:commitDetails:dismissed'),
files: configuration.get('views.commitDetails.files'), files: configuration.get('views.commitDetails.files'),
@ -534,7 +534,10 @@ export class CommitDetailsWebviewView extends WebviewViewBase
preferences.autolinksExpanded != null && preferences.autolinksExpanded != null &&
this._context.preferences?.autolinksExpanded !== preferences.autolinksExpanded this._context.preferences?.autolinksExpanded !== preferences.autolinksExpanded
) { ) {
void this.container.storage.store('views:commitDetails:autolinksExpanded', preferences.autolinksExpanded);
void this.container.storage.storeWorkspace(
'views:commitDetails:autolinksExpanded',
preferences.autolinksExpanded,
);
changes.autolinksExpanded = preferences.autolinksExpanded; changes.autolinksExpanded = preferences.autolinksExpanded;
} }

Loading…
Cancel
Save