From c0883935c4c508481eb6d669dbb19a8fb8c3291e Mon Sep 17 00:00:00 2001 From: Sherfin Shamsudeen Date: Mon, 12 Dec 2022 21:45:44 +0530 Subject: [PATCH] Move all state setting to inside of then block of computeComponentState in fetchApp (#4946) --- frontend/src/Editor/Editor.jsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/frontend/src/Editor/Editor.jsx b/frontend/src/Editor/Editor.jsx index 30bda4e75b..49e7e2616f 100644 --- a/frontend/src/Editor/Editor.jsx +++ b/frontend/src/Editor/Editor.jsx @@ -415,17 +415,16 @@ class EditorComponent extends React.Component { }, }, async () => { - // TODO: Check if this runQueries is required - computeComponentState(this, this.state.appDefinition.pages[homePageId]?.components ?? {}).then(() => { + computeComponentState(this, this.state.appDefinition.pages[homePageId]?.components ?? {}).then(async () => { this.runQueries(data.data_queries); + this.setWindowTitle(data.name); + this.setState({ + showComments: !!queryString.parse(this.props.location.search).threadId, + }); + for (const event of dataDefinition.pages[homePageId]?.events ?? []) { + await this.handleEvent(event.eventId, event); + } }); - this.setWindowTitle(data.name); - this.setState({ - showComments: !!queryString.parse(this.props.location.search).threadId, - }); - for (const event of dataDefinition.pages[homePageId]?.events ?? []) { - await this.handleEvent(event.eventId, event); - } } );