diff options
Diffstat (limited to 'src/features/todos/components/TodosWebview.js')
-rw-r--r-- | src/features/todos/components/TodosWebview.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/features/todos/components/TodosWebview.js b/src/features/todos/components/TodosWebview.js index d052da6f2..c252aff90 100644 --- a/src/features/todos/components/TodosWebview.js +++ b/src/features/todos/components/TodosWebview.js | |||
@@ -1,12 +1,14 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer } from 'mobx-react'; | 3 | import { observer, inject } from 'mobx-react'; |
4 | import injectSheet from 'react-jss'; | 4 | import injectSheet from 'react-jss'; |
5 | import Webview from 'react-electron-web-view'; | 5 | import Webview from 'react-electron-web-view'; |
6 | import { Icon } from '@meetfranz/ui'; | 6 | import { Icon } from '@meetfranz/ui'; |
7 | import { defineMessages, intlShape } from 'react-intl'; | 7 | import { defineMessages, intlShape } from 'react-intl'; |
8 | 8 | ||
9 | import { mdiCheckAll } from '@mdi/js'; | 9 | import { mdiCheckAll } from '@mdi/js'; |
10 | import SettingsStore from '../../../stores/SettingsStore'; | ||
11 | |||
10 | import * as environment from '../../../environment'; | 12 | import * as environment from '../../../environment'; |
11 | import Appear from '../../../components/ui/effects/Appear'; | 13 | import Appear from '../../../components/ui/effects/Appear'; |
12 | import UpgradeButton from '../../../components/ui/UpgradeButton'; | 14 | import UpgradeButton from '../../../components/ui/UpgradeButton'; |
@@ -80,7 +82,7 @@ const styles = theme => ({ | |||
80 | }, | 82 | }, |
81 | }); | 83 | }); |
82 | 84 | ||
83 | @injectSheet(styles) @observer | 85 | @injectSheet(styles) @observer @inject('stores') |
84 | class TodosWebview extends Component { | 86 | class TodosWebview extends Component { |
85 | static propTypes = { | 87 | static propTypes = { |
86 | classes: PropTypes.object.isRequired, | 88 | classes: PropTypes.object.isRequired, |
@@ -91,6 +93,9 @@ class TodosWebview extends Component { | |||
91 | width: PropTypes.number.isRequired, | 93 | width: PropTypes.number.isRequired, |
92 | minWidth: PropTypes.number.isRequired, | 94 | minWidth: PropTypes.number.isRequired, |
93 | isTodosIncludedInCurrentPlan: PropTypes.bool.isRequired, | 95 | isTodosIncludedInCurrentPlan: PropTypes.bool.isRequired, |
96 | stores: PropTypes.shape({ | ||
97 | settings: PropTypes.instanceOf(SettingsStore).isRequired, | ||
98 | }).isRequired, | ||
94 | }; | 99 | }; |
95 | 100 | ||
96 | state = { | 101 | state = { |
@@ -181,6 +186,7 @@ class TodosWebview extends Component { | |||
181 | classes, | 186 | classes, |
182 | isVisible, | 187 | isVisible, |
183 | isTodosIncludedInCurrentPlan, | 188 | isTodosIncludedInCurrentPlan, |
189 | stores, | ||
184 | } = this.props; | 190 | } = this.props; |
185 | 191 | ||
186 | const { | 192 | const { |
@@ -220,7 +226,7 @@ class TodosWebview extends Component { | |||
220 | partition="persist:todos" | 226 | partition="persist:todos" |
221 | preload="./features/todos/preload.js" | 227 | preload="./features/todos/preload.js" |
222 | ref={(webview) => { this.webview = webview ? webview.view : null; }} | 228 | ref={(webview) => { this.webview = webview ? webview.view : null; }} |
223 | src={environment.TODOS_FRONTEND} | 229 | src={stores.settings.all.app.todoServer || environment.TODOS_FRONTEND} |
224 | /> | 230 | /> |
225 | ) : ( | 231 | ) : ( |
226 | <Appear> | 232 | <Appear> |