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 f24c0b044..e9b1963f7 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'; |
@@ -77,7 +79,7 @@ const styles = theme => ({ | |||
77 | }, | 79 | }, |
78 | }); | 80 | }); |
79 | 81 | ||
80 | @injectSheet(styles) @observer | 82 | @injectSheet(styles) @inject('stores') @observer |
81 | class TodosWebview extends Component { | 83 | class TodosWebview extends Component { |
82 | static propTypes = { | 84 | static propTypes = { |
83 | classes: PropTypes.object.isRequired, | 85 | classes: PropTypes.object.isRequired, |
@@ -88,6 +90,9 @@ class TodosWebview extends Component { | |||
88 | width: PropTypes.number.isRequired, | 90 | width: PropTypes.number.isRequired, |
89 | minWidth: PropTypes.number.isRequired, | 91 | minWidth: PropTypes.number.isRequired, |
90 | isTodosIncludedInCurrentPlan: PropTypes.bool.isRequired, | 92 | isTodosIncludedInCurrentPlan: PropTypes.bool.isRequired, |
93 | stores: PropTypes.shape({ | ||
94 | settings: PropTypes.instanceOf(SettingsStore).isRequired, | ||
95 | }).isRequired, | ||
91 | }; | 96 | }; |
92 | 97 | ||
93 | state = { | 98 | state = { |
@@ -178,6 +183,7 @@ class TodosWebview extends Component { | |||
178 | classes, | 183 | classes, |
179 | isVisible, | 184 | isVisible, |
180 | isTodosIncludedInCurrentPlan, | 185 | isTodosIncludedInCurrentPlan, |
186 | stores, | ||
181 | } = this.props; | 187 | } = this.props; |
182 | 188 | ||
183 | const { | 189 | const { |
@@ -217,7 +223,7 @@ class TodosWebview extends Component { | |||
217 | partition="persist:todos" | 223 | partition="persist:todos" |
218 | preload="./features/todos/preload.js" | 224 | preload="./features/todos/preload.js" |
219 | ref={(webview) => { this.webview = webview ? webview.view : null; }} | 225 | ref={(webview) => { this.webview = webview ? webview.view : null; }} |
220 | src={environment.TODOS_FRONTEND} | 226 | src={stores.settings.all.app.todoServer || environment.TODOS_FRONTEND} |
221 | /> | 227 | /> |
222 | ) : ( | 228 | ) : ( |
223 | <Appear> | 229 | <Appear> |