diff --git a/webapp/src/app.tsx b/webapp/src/app.tsx index f25bf3197..3db655f2e 100644 --- a/webapp/src/app.tsx +++ b/webapp/src/app.tsx @@ -42,7 +42,7 @@ if (Utils.isDesktop() && Utils.isFocalboardPlugin()) { return } - const pathName = event.data.message.pathName + const pathName = event.data.message?.pathName if (!pathName) { return } diff --git a/webapp/src/pages/boardPage.tsx b/webapp/src/pages/boardPage.tsx index 93e062d8d..bd15f2ba2 100644 --- a/webapp/src/pages/boardPage.tsx +++ b/webapp/src/pages/boardPage.tsx @@ -3,7 +3,7 @@ import React, {useEffect, useState} from 'react' import {batch} from 'react-redux' import {FormattedMessage, useIntl} from 'react-intl' -import {generatePath, useHistory, useRouteMatch} from 'react-router-dom' +import {generatePath, Redirect, useHistory, useRouteMatch} from 'react-router-dom' import {useHotkeys} from 'react-hotkeys-hook' import {Block} from '../blocks/block' @@ -228,6 +228,13 @@ const BoardPage = (props: Props) => { } }) + // this is needed to redirect to dashboard + // when opening Focalboard for the first time + const shouldGoToDashboard = Utils.isFocalboardPlugin() && workspaceId === '0' && !match.params.boardId && !match.params.viewId + if (shouldGoToDashboard) { + return () + } + return (
{websocketClosed && diff --git a/webapp/src/store/initialLoad.ts b/webapp/src/store/initialLoad.ts index c330f140c..39adc5cb6 100644 --- a/webapp/src/store/initialLoad.ts +++ b/webapp/src/store/initialLoad.ts @@ -22,9 +22,6 @@ export const initialLoad = createAsyncThunk( client.getAllBlocks(), getUserWorkspaces(), ]) - if (!workspace) { - throw new Error('no_workspace') - } return { workspace, workspaceUsers,