Skip to content

Commit db5409f

Browse files
committed
[dashboard] align client registration
1 parent 314f66c commit db5409f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

components/dashboard/src/start/StartWorkspace.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,13 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
131131
}
132132

133133
try {
134-
this.toDispose.push(getGitpodService().registerClient(this));
134+
this.toDispose.push(
135+
getGitpodService().registerClient({
136+
notifyDidOpenConnection: () => this.fetchWorkspaceInfo(undefined),
137+
onInstanceUpdate: (workspaceInstance: WorkspaceInstance) =>
138+
this.onInstanceUpdate(workspaceInstance),
139+
}),
140+
);
135141
} catch (error) {
136142
console.error(error);
137143
this.setState({ error });
@@ -297,10 +303,6 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
297303
this.setState({ ideOptions });
298304
}
299305

300-
notifyDidOpenConnection() {
301-
this.fetchWorkspaceInfo(undefined);
302-
}
303-
304306
async onInstanceUpdate(workspaceInstance: WorkspaceInstance) {
305307
if (workspaceInstance.workspaceId !== this.props.workspaceId) {
306308
return;

0 commit comments

Comments
 (0)