Skip to content

Commit

Permalink
fixed failed tests
Browse files Browse the repository at this point in the history
Signed-off-by: Yulong Ruan <[email protected]>
  • Loading branch information
ruanyl committed Mar 21, 2024
1 parent 7c6b1e9 commit cacb52f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/plugins/workspace/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type WorkspaceAppType = (params: AppMountParameters, services: Services) => () =
export class WorkspacePlugin implements Plugin<{}, {}, {}> {
private coreStart?: CoreStart;
private currentWorkspaceSubscription?: Subscription;
private currentWorkspaceIdSubscription?: Subscription;
private _changeSavedObjectCurrentWorkspace() {
if (this.coreStart) {
return this.coreStart.workspaces.currentWorkspaceId$.subscribe((currentWorkspaceId) => {
Expand Down Expand Up @@ -166,7 +167,7 @@ export class WorkspacePlugin implements Plugin<{}, {}, {}> {
public start(core: CoreStart) {
this.coreStart = core;

this.currentWorkspaceSubscription = this._changeSavedObjectCurrentWorkspace();
this.currentWorkspaceIdSubscription = this._changeSavedObjectCurrentWorkspace();

// When starts, filter the nav links based on the current workspace
this.filterNavLinks(core);
Expand All @@ -176,5 +177,6 @@ export class WorkspacePlugin implements Plugin<{}, {}, {}> {

public stop() {
this.currentWorkspaceSubscription?.unsubscribe();
this.currentWorkspaceIdSubscription?.unsubscribe();

Check warning on line 180 in src/plugins/workspace/public/plugin.ts

View check run for this annotation

Codecov / codecov/patch

src/plugins/workspace/public/plugin.ts#L180

Added line #L180 was not covered by tests
}
}

0 comments on commit cacb52f

Please sign in to comment.