This commit is contained in:
Tom Moor
2018-12-16 17:57:41 -08:00
parent 3330359c4c
commit 29630e68d2
4 changed files with 14 additions and 11 deletions

View File

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

View File

@@ -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);

View File

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

View File

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