Allow no workspace and send to dashboard is that happens (#1296)

This commit is contained in:
Harshil Sharma 2021-09-22 09:42:41 +05:30 committed by GitHub
parent 950a88be5e
commit 2b7bd911c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View file

@ -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
}

View file

@ -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 (<Redirect to={'/dashboard'}/>)
}
return (
<div className='BoardPage'>
{websocketClosed &&

View file

@ -22,9 +22,6 @@ export const initialLoad = createAsyncThunk(
client.getAllBlocks(),
getUserWorkspaces(),
])
if (!workspace) {
throw new Error('no_workspace')
}
return {
workspace,
workspaceUsers,