Skip to content

Commit

Permalink
Ensure that startup UI extensions are rendered correctly (#217)
Browse files Browse the repository at this point in the history
UI extensions that should be active i.e. visible on startup might be activated to early (before the initial model loading is completed) which can cause rendering issues in some cases. This can be avoided by enabling these UI extensions after the model has been initialized.
(eclipse-glsp/glsp#585)
  • Loading branch information
tortmayr authored Jan 2, 2023
1 parent 6ec1da0 commit 1e39678
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/workflow-standalone/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import {
BaseJsonrpcGLSPClient,
configureServerActions,
EnableToolPaletteAction,
GLSPActionDispatcher,
GLSPClient,
GLSPDiagramServer,
IActionDispatcher,
RequestModelAction,
RequestTypeHintsAction,
TYPES
Expand Down Expand Up @@ -56,7 +56,7 @@ async function initialize(connectionProvider: MessageConnection): Promise<void>
});
await configureServerActions(result, diagramType, container);

const actionDispatcher = container.get<IActionDispatcher>(TYPES.IActionDispatcher);
const actionDispatcher = container.get(GLSPActionDispatcher);

await client.initializeClientSession({ clientSessionId: diagramServer.clientId, diagramType });
actionDispatcher.dispatch(
Expand All @@ -68,6 +68,7 @@ async function initialize(connectionProvider: MessageConnection): Promise<void>
})
);
actionDispatcher.dispatch(RequestTypeHintsAction.create());
await actionDispatcher.onceModelInitialized();
actionDispatcher.dispatch(EnableToolPaletteAction.create());
}

Expand Down

0 comments on commit 1e39678

Please sign in to comment.