Closes #815
This commit is contained in:
@@ -15,7 +15,6 @@ import { LoadingIndicatorBar } from 'components/LoadingIndicator';
|
||||
import Sidebar from 'components/Sidebar';
|
||||
import SettingsSidebar from 'components/Sidebar/Settings';
|
||||
import Modals from 'components/Modals';
|
||||
import Toasts from 'components/Toasts';
|
||||
import ErrorSuspended from 'scenes/ErrorSuspended';
|
||||
|
||||
import AuthStore from 'stores/AuthStore';
|
||||
@@ -99,7 +98,6 @@ class Layout extends React.Component<Props> {
|
||||
</Content>
|
||||
</Flex>
|
||||
<Modals ui={ui} />
|
||||
<Toasts ui={ui} />
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { observer } from 'mobx-react';
|
||||
import { observer, inject } from 'mobx-react';
|
||||
import styled from 'styled-components';
|
||||
import Toast from './components/Toast';
|
||||
import UiStore from '../../stores/UiStore';
|
||||
@@ -41,4 +41,4 @@ const List = styled.ol`
|
||||
z-index: 1000;
|
||||
`;
|
||||
|
||||
export default Toasts;
|
||||
export default inject('ui')(Toasts);
|
||||
|
||||
14
app/index.js
14
app/index.js
@@ -13,6 +13,7 @@ import 'shared/styles/prism.css';
|
||||
import ErrorBoundary from 'components/ErrorBoundary';
|
||||
import ScrollToTop from 'components/ScrollToTop';
|
||||
import ScrollToAnchor from 'components/ScrollToAnchor';
|
||||
import Toasts from 'components/Toasts';
|
||||
import Routes from './routes';
|
||||
|
||||
let DevTools;
|
||||
@@ -30,11 +31,14 @@ if (element) {
|
||||
<ErrorBoundary>
|
||||
<Provider {...stores}>
|
||||
<Router>
|
||||
<ScrollToTop>
|
||||
<ScrollToAnchor>
|
||||
<Routes />
|
||||
</ScrollToAnchor>
|
||||
</ScrollToTop>
|
||||
<React.Fragment>
|
||||
<ScrollToTop>
|
||||
<ScrollToAnchor>
|
||||
<Routes />
|
||||
</ScrollToAnchor>
|
||||
</ScrollToTop>
|
||||
<Toasts />
|
||||
</React.Fragment>
|
||||
</Router>
|
||||
</Provider>
|
||||
</ErrorBoundary>
|
||||
|
||||
@@ -297,7 +297,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
);
|
||||
}
|
||||
|
||||
if (!document || !team || !Editor) {
|
||||
if (!document || !Editor) {
|
||||
return (
|
||||
<Container column auto>
|
||||
<PageTitle title={location.state ? location.state.title : ''} />
|
||||
@@ -308,7 +308,8 @@ class DocumentScene extends React.Component<Props> {
|
||||
);
|
||||
}
|
||||
|
||||
const embedsDisabled = document.embedsDisabled || !team.documentEmbeds;
|
||||
const embedsDisabled =
|
||||
document.embedsDisabled || (team && !team.documentEmbeds);
|
||||
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
|
||||
Reference in New Issue
Block a user