diff --git a/webapp/src/app.tsx b/webapp/src/app.tsx index 4a26092eb..d1f305575 100644 --- a/webapp/src/app.tsx +++ b/webapp/src/app.tsx @@ -65,6 +65,12 @@ export default class App extends React.PureComponent { + + + {this.state.initialLoad && !this.state.user && } diff --git a/webapp/src/components/shareBoardComponent.tsx b/webapp/src/components/shareBoardComponent.tsx index b8d58f1d8..f26436a31 100644 --- a/webapp/src/components/shareBoardComponent.tsx +++ b/webapp/src/components/shareBoardComponent.tsx @@ -47,6 +47,7 @@ class ShareBoardComponent extends React.PureComponent { const readToken = (sharing && isSharing) ? sharing.token : '' const shareUrl = new URL(window.location.toString()) shareUrl.searchParams.set('r', readToken) + shareUrl.pathname = '/shared' let stateDescription: string if (isSharing) { diff --git a/webapp/src/pages/boardPage.tsx b/webapp/src/pages/boardPage.tsx index 0154cf656..47bb31470 100644 --- a/webapp/src/pages/boardPage.tsx +++ b/webapp/src/pages/boardPage.tsx @@ -12,6 +12,7 @@ import {BoardTree, MutableBoardTree} from '../viewModel/boardTree' import {MutableWorkspaceTree, WorkspaceTree} from '../viewModel/workspaceTree' type Props = { + readonly?: boolean setLanguage: (lang: string) => void } @@ -20,7 +21,6 @@ type State = { viewId: string workspaceTree: WorkspaceTree boardTree?: BoardTree - readonly: boolean } export default class BoardPage extends React.Component { @@ -31,13 +31,11 @@ export default class BoardPage extends React.Component { const queryString = new URLSearchParams(window.location.search) const boardId = queryString.get('id') || '' const viewId = queryString.get('v') || '' - const readonly = Boolean(queryString.get('r')) this.state = { boardId, viewId, workspaceTree: new MutableWorkspaceTree(), - readonly, } Utils.log(`BoardPage. boardId: ${boardId}`) @@ -76,7 +74,7 @@ export default class BoardPage extends React.Component { return } - if (this.state.readonly) { + if (this.props.readonly) { return } @@ -143,7 +141,7 @@ export default class BoardPage extends React.Component { this.setSearchText(text) }} setLanguage={this.props.setLanguage} - readonly={this.state.readonly} + readonly={this.props.readonly || false} /> ) @@ -255,7 +253,7 @@ export default class BoardPage extends React.Component { if (boardId) { newUrl += `?id=${encodeURIComponent(boardId)}` - if (this.state.readonly) { + if (this.props.readonly) { newUrl += '&r=1' } } @@ -273,7 +271,7 @@ export default class BoardPage extends React.Component { } let newUrl = window.location.protocol + '//' + window.location.host + window.location.pathname + `?id=${encodeURIComponent(boardId)}&v=${encodeURIComponent(viewId)}` - if (this.state.readonly) { + if (this.props.readonly) { newUrl += '&r=1' } window.history.pushState({path: newUrl}, '', newUrl)