From d2a8f20390875cd9b5b861916403e93ae491aa47 Mon Sep 17 00:00:00 2001 From: Chen-I Lim Date: Mon, 19 Oct 2020 12:44:26 -0700 Subject: [PATCH] Fix: missing boardId state after showView --- src/client/pages/boardPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/pages/boardPage.tsx b/src/client/pages/boardPage.tsx index e6baf4d88..868a6e0ce 100644 --- a/src/client/pages/boardPage.tsx +++ b/src/client/pages/boardPage.tsx @@ -175,6 +175,7 @@ export default class BoardPage extends React.Component { this.setState({ ...this.state, boardTree, + boardId, viewId: boardTree.activeView.id }) Utils.log(`sync complete: ${boardTree.board.id} (${boardTree.board.title})`) @@ -197,7 +198,7 @@ export default class BoardPage extends React.Component { showView(viewId: string) { this.state.boardTree.setActiveView(viewId) - this.setState({ viewId, boardTree: this.state.boardTree }) + this.setState({...this.state, viewId }) const newUrl = window.location.protocol + "//" + window.location.host + window.location.pathname + `?id=${encodeURIComponent(this.state.boardId)}&v=${encodeURIComponent(viewId)}` window.history.pushState({ path: newUrl }, "", newUrl) }