diff --git a/webapp/src/app.tsx b/webapp/src/app.tsx index 3aa05c362..acbb0e50b 100644 --- a/webapp/src/app.tsx +++ b/webapp/src/app.tsx @@ -49,10 +49,7 @@ const App = React.memo((): JSX.Element => { > - +
diff --git a/webapp/src/octoListener.ts b/webapp/src/octoListener.ts index 3628e2987..8da5a6dd8 100644 --- a/webapp/src/octoListener.ts +++ b/webapp/src/octoListener.ts @@ -138,7 +138,11 @@ class OctoListener { this.blockIds = [] this.onChange = undefined this.isInitialized = false - ws.close() + try { + ws?.close() + } catch { + Utils.log('OctoListener unable to close the websocket') + } } private authenticate(workspaceId: string): void { diff --git a/webapp/src/pages/boardPage.tsx b/webapp/src/pages/boardPage.tsx index 0e80322f7..922c316eb 100644 --- a/webapp/src/pages/boardPage.tsx +++ b/webapp/src/pages/boardPage.tsx @@ -81,6 +81,15 @@ class BoardPage extends React.Component { const board = this.state.boardTree?.board const prevBoard = prevState.boardTree?.board + const boardId = this.props.match.params.boardId + const prevBoardId = prevProps.match.params.boardId + const viewId = this.props.match.params.viewId + const prevViewId = prevProps.match.params.viewId + + if (boardId && (boardId !== prevBoardId || viewId !== prevViewId)) { + this.attachToBoard(boardId, viewId) + } + const activeView = this.state.boardTree?.activeView const prevActiveView = prevState.boardTree?.activeView