Skip to content

Commit

Permalink
Don't re-open hidden tree-view after reload
Browse files Browse the repository at this point in the history
The PluginViewWidget has a property to suppress visibility updates
from a `when` clause in the case a user specifically requests to hide
it. However when the browser got reloaded, the flag was reset to
default and did not keep the hide request from the user.

This change preserves the flag mentioned above in the PluginViewWidget
state, this state is preserved and then available for use in
`restoreState` where the flag is now updated to the state before the
browser reloads.

Signed-off-by: Alvaro Sanchez-Leon <alvaro.sanchez-leon@ericsson.com>
  • Loading branch information
alvsan09 committed Jun 2, 2021
1 parent 011f76e commit 7a84fe4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/plugin-ext/src/main/browser/view/plugin-view-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ export class PluginViewWidget extends Panel implements StatefulWidget {
return {
label: this.title.label,
message: this.message,
widgets: this.widgets
widgets: this.widgets,
suppressVisibilityClause: this._suppressUpdateViewVisibility
};
}

restoreState(state: PluginViewWidget.State): void {
this.title.label = state.label;
this.message = state.message;
this.suppressUpdateViewVisibility = state.suppressVisibilityClause;
for (const widget of state.widgets) {
this.addWidget(widget);
}
Expand Down Expand Up @@ -131,8 +133,9 @@ export class PluginViewWidget extends Panel implements StatefulWidget {
}
export namespace PluginViewWidget {
export interface State {
label: string
message?: string;
widgets: ReadonlyArray<Widget>
label: string,
message?: string,
widgets: ReadonlyArray<Widget>,
suppressVisibilityClause: boolean
}
}

0 comments on commit 7a84fe4

Please sign in to comment.