Skip to content

Commit

Permalink
[dashboard] align client registration
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTugarev committed Jun 7, 2022
1 parent 314f66c commit db5409f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions components/dashboard/src/start/StartWorkspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
}

try {
this.toDispose.push(getGitpodService().registerClient(this));
this.toDispose.push(
getGitpodService().registerClient({
notifyDidOpenConnection: () => this.fetchWorkspaceInfo(undefined),
onInstanceUpdate: (workspaceInstance: WorkspaceInstance) =>
this.onInstanceUpdate(workspaceInstance),
}),
);
} catch (error) {
console.error(error);
this.setState({ error });
Expand Down Expand Up @@ -297,10 +303,6 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
this.setState({ ideOptions });
}

notifyDidOpenConnection() {
this.fetchWorkspaceInfo(undefined);
}

async onInstanceUpdate(workspaceInstance: WorkspaceInstance) {
if (workspaceInstance.workspaceId !== this.props.workspaceId) {
return;
Expand Down

0 comments on commit db5409f

Please sign in to comment.