diff --git a/app/components/Layout.js b/app/components/Layout.js index b219192a2..d8f223de5 100644 --- a/app/components/Layout.js +++ b/app/components/Layout.js @@ -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 { - ); } diff --git a/app/components/Toasts/Toasts.js b/app/components/Toasts/Toasts.js index cc5d4347d..66989637d 100644 --- a/app/components/Toasts/Toasts.js +++ b/app/components/Toasts/Toasts.js @@ -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); diff --git a/app/index.js b/app/index.js index b2d2ab8ea..b4336801b 100644 --- a/app/index.js +++ b/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) { - - - - - + + + + + + + + diff --git a/app/scenes/Document/Document.js b/app/scenes/Document/Document.js index d5179f99c..d08b29d4f 100644 --- a/app/scenes/Document/Document.js +++ b/app/scenes/Document/Document.js @@ -297,7 +297,7 @@ class DocumentScene extends React.Component { ); } - if (!document || !team || !Editor) { + if (!document || !Editor) { return ( @@ -308,7 +308,8 @@ class DocumentScene extends React.Component { ); } - const embedsDisabled = document.embedsDisabled || !team.documentEmbeds; + const embedsDisabled = + document.embedsDisabled || (team && !team.documentEmbeds); return (