Browse Source

Fixes persisted state issues

main
Eric Amodio 1 year ago
parent
commit
29237c4928
3 changed files with 5 additions and 16 deletions
  1. +0
    -9
      src/webviews/apps/commitDetails/commitDetails.ts
  2. +1
    -1
      src/webviews/apps/plus/graph/graph.tsx
  3. +4
    -6
      src/webviews/apps/shared/appBase.ts

+ 0
- 9
src/webviews/apps/commitDetails/commitDetails.ts View File

@ -135,15 +135,6 @@ export class CommitDetailsApp extends App> {
}
}
protected override setState(state: Partial<Serialized<State>>) {
super.setState({
selected:
state.selected != null
? { ...state.selected, autolinks: undefined, files: undefined, stats: undefined }
: undefined,
});
}
async onExplainCommit(e: MouseEvent) {
const el = e.target as HTMLButtonElement;
if (el.getAttribute('aria-busy') === 'true') return;

+ 1
- 1
src/webviews/apps/plus/graph/graph.tsx View File

@ -479,7 +479,7 @@ export class GraphApp extends App {
const themingChanged = this.ensureTheming(state);
this.state = state;
super.setState({ selectedRepository: state.selectedRepository });
super.setState({ timestamp: state.timestamp, selectedRepository: state.selectedRepository });
this.callback?.(this.state, type, themingChanged);
}

+ 4
- 6
src/webviews/apps/shared/appBase.ts View File

@ -70,12 +70,10 @@ export abstract class App
this._api = acquireVsCodeApi();
if (this.state != null) {
const state = this.getState();
if (state != null) {
if (this.state.timestamp > (state.timestamp ?? 0)) {
this._api.setState(this.state);
} else {
this.state = state;
}
if (this.state.timestamp >= (state?.timestamp ?? 0)) {
this._api.setState(this.state);
} else {
this.state = state!;
}
}

Loading…
Cancel
Save