Show error if Read-Only board is not available (#1022)

This commit is contained in:
Scott Bishel 2021-08-18 17:36:27 -06:00 committed by GitHub
parent 663ff4c8da
commit e5692c9e7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import React, {useEffect, useState} from 'react'
import {batch} from 'react-redux'
import {FormattedMessage} from 'react-intl'
import {FormattedMessage, useIntl} from 'react-intl'
import {generatePath, useHistory, useRouteMatch} from 'react-router-dom'
import {useHotkeys} from 'react-hotkeys-hook'
@ -35,6 +35,7 @@ type Props = {
const websocketTimeoutForBanner = 5000
const BoardPage = (props: Props) => {
const intl = useIntl()
const board = useAppSelector(getCurrentBoard)
const activeView = useAppSelector(getCurrentView)
const boardViews = useAppSelector(getCurrentBoardViews)
@ -220,6 +221,10 @@ const BoardPage = (props: Props) => {
/>
</a>
</div>}
{props.readonly && board === undefined &&
<div className='error'>
{intl.formatMessage({id: 'BoardPage.syncFailed', defaultMessage: 'Board may be deleted or access revoked.'})}
</div>}
<Workspace readonly={props.readonly || false}/>
</div>
)