Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
pal03377 committed Jul 22, 2023
1 parent f37b7d3 commit 1ea1caa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
15 changes: 11 additions & 4 deletions src/main/apollon-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ export class ApollonEditor {
private ensureInitialized() {
if (!this.store) {
// tslint:disable-next-line:no-console
console.error('The application state of Apollon could not be retrieved. The editor may already be destroyed or you might need to `await apollonEditor.renderCycle`.');
throw new Error('The application state of Apollon could not be retrieved. The editor may already be destroyed or you might need to `await apollonEditor.renderCycle`.');
console.error(
'The application state of Apollon could not be retrieved. The editor may already be destroyed or you might need to `await apollonEditor.renderCycle`.',
);
throw new Error(
'The application state of Apollon could not be retrieved. The editor may already be destroyed or you might need to `await apollonEditor.renderCycle`.',
);
}
}

Expand Down Expand Up @@ -113,7 +117,10 @@ export class ApollonEditor {
private errorSubscribers: { [key: number]: (error: Error) => void } = {};
private nextRenderPromise: Promise<void>;

constructor(private container: HTMLElement, private options: Apollon.ApollonOptions) {
constructor(
private container: HTMLElement,
private options: Apollon.ApollonOptions,
) {
let state: PartialModelState | undefined = options.model ? ModelState.fromModel(options.model) : {};

state = {
Expand Down Expand Up @@ -158,7 +165,7 @@ export class ApollonEditor {
},
state,
styles: options.theme,
locale: options.locale
locale: options.locale,
});
const errorBoundary = createElement(ErrorBoundary, { onError: this.onErrorOccurred.bind(this) }, element);
this.root = createRoot(container);
Expand Down
12 changes: 7 additions & 5 deletions src/main/scenes/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export class Application extends React.Component<Props, State> {
this.resolveInitialized = resolve;
});


setCanvas = (ref: CanvasComponent) => {
if (ref && ref.layer.current) {
this.setState({ canvas: { ...ref, layer: ref.layer.current } });
Expand All @@ -61,10 +60,13 @@ export class Application extends React.Component<Props, State> {
return (
<CanvasProvider value={canvasContext}>
<RootProvider value={rootContext}>
<StoreProvider initialState={this.props.state} ref={(ref) => {
this.store ??= ref as ModelStore;
this.resolveInitialized();
}}>
<StoreProvider
initialState={this.props.state}
ref={(ref) => {
this.store ??= ref as ModelStore;
this.resolveInitialized();
}}
>
<I18nProvider locale={this.props.locale}>
<Theme styles={this.props.styles} scale={this.props.state?.editor?.scale}>
<Layout className="apollon-editor" ref={this.setLayout}>
Expand Down

0 comments on commit 1ea1caa

Please sign in to comment.