Allow no workspace and send to dashboard is that happens (#1296)
This commit is contained in:
parent
950a88be5e
commit
2b7bd911c9
3 changed files with 9 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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 &&
|
||||
|
|
|
@ -22,9 +22,6 @@ export const initialLoad = createAsyncThunk(
|
|||
client.getAllBlocks(),
|
||||
getUserWorkspaces(),
|
||||
])
|
||||
if (!workspace) {
|
||||
throw new Error('no_workspace')
|
||||
}
|
||||
return {
|
||||
workspace,
|
||||
workspaceUsers,
|
||||
|
|
Loading…
Reference in a new issue