diff options
-rw-r--r-- | src/client/views/Main.tsx | 14 | ||||
-rw-r--r-- | src/client/views/collections/CollectionDockingView.tsx | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx index b59a2a4f7..db7138965 100644 --- a/src/client/views/Main.tsx +++ b/src/client/views/Main.tsx @@ -91,14 +91,12 @@ function init(mainDocId: string) { mainContainer = Documents.DockDocument(JSON.stringify({ content: [{ type: 'row', content: [] }] }), { title: "main container" }, mainDocId); Utils.Emit(Server.Socket, MessageStore.AddDocument, new DocumentTransfer(mainContainer.ToJson())) - setTimeout(() => { - mainfreeform = Documents.FreeformDocument([], { x: 0, y: 400, title: "mini collection" }); - Utils.Emit(Server.Socket, MessageStore.AddDocument, new DocumentTransfer(mainfreeform.ToJson())); + mainfreeform = Documents.FreeformDocument([], { x: 0, y: 400, title: "mini collection" }); + Utils.Emit(Server.Socket, MessageStore.AddDocument, new DocumentTransfer(mainfreeform.ToJson())); - var docs = [mainfreeform].map(doc => CollectionDockingView.makeDocumentConfig(doc)); - mainContainer.SetText(KeyStore.Data, JSON.stringify({ content: [{ type: 'row', content: docs }] })); - mainContainer.Set(KeyStore.ActiveFrame, mainfreeform); - }, 0); + var docs = [mainfreeform].map(doc => CollectionDockingView.makeDocumentConfig(doc)); + mainContainer.SetText(KeyStore.Data, JSON.stringify({ content: [{ type: 'row', content: docs }] })); + mainContainer.Set(KeyStore.ActiveFrame, mainfreeform); } let addImageNode = action(() => { @@ -191,7 +189,7 @@ function init(mainDocId: string) { left: '4px', width: '150px' }} onClick={() => WorkspacesMenu.Instance.toggle()}>Workspaces</button> - <WorkspacesMenu load={init} new={getNewWorkspace} active={mainDocId}/> + <WorkspacesMenu load={init} new={getNewWorkspace} active={mainDocId} /> </div>), document.getElementById('root')); }) diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index 2230ec14f..ac8bac22e 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -163,7 +163,7 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp if (this._containerRef.current) { reaction( () => this.props.Document.GetText(KeyStore.Data, ""), - () => this.setupGoldenLayout(), { fireImmediately: true }); + () => setTimeout(() => this.setupGoldenLayout(), 1), { fireImmediately: true }); window.addEventListener('resize', this.onResize); // bcz: would rather add this event to the parent node, but resize events only come from Window } |