aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/todos/components/TodosWebview.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/todos/components/TodosWebview.js')
-rw-r--r--src/features/todos/components/TodosWebview.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/features/todos/components/TodosWebview.js b/src/features/todos/components/TodosWebview.js
index 18a900e8a..634ec4caa 100644
--- a/src/features/todos/components/TodosWebview.js
+++ b/src/features/todos/components/TodosWebview.js
@@ -14,8 +14,6 @@ import Appear from '../../../components/ui/effects/Appear';
14import UpgradeButton from '../../../components/ui/UpgradeButton'; 14import UpgradeButton from '../../../components/ui/UpgradeButton';
15import { TODOS_PARTITION_ID } from '..'; 15import { TODOS_PARTITION_ID } from '..';
16 16
17import userAgent from '../../../helpers/userAgent-helpers';
18
19// NOTE: https://stackoverflow.com/questions/5717093/check-if-a-javascript-string-is-a-url 17// NOTE: https://stackoverflow.com/questions/5717093/check-if-a-javascript-string-is-a-url
20function validURL(str) { 18function validURL(str) {
21 let url; 19 let url;
@@ -112,6 +110,7 @@ class TodosWebview extends Component {
112 resize: PropTypes.func.isRequired, 110 resize: PropTypes.func.isRequired,
113 width: PropTypes.number.isRequired, 111 width: PropTypes.number.isRequired,
114 minWidth: PropTypes.number.isRequired, 112 minWidth: PropTypes.number.isRequired,
113 userAgent: PropTypes.string.isRequired,
115 isTodosIncludedInCurrentPlan: PropTypes.bool.isRequired, 114 isTodosIncludedInCurrentPlan: PropTypes.bool.isRequired,
116 stores: PropTypes.shape({ 115 stores: PropTypes.shape({
117 settings: PropTypes.instanceOf(SettingsStore).isRequired, 116 settings: PropTypes.instanceOf(SettingsStore).isRequired,
@@ -139,11 +138,6 @@ class TodosWebview extends Component {
139 this.node.addEventListener('mousemove', this.resizePanel.bind(this)); 138 this.node.addEventListener('mousemove', this.resizePanel.bind(this));
140 this.node.addEventListener('mouseup', this.stopResize.bind(this)); 139 this.node.addEventListener('mouseup', this.stopResize.bind(this));
141 this.node.addEventListener('mouseleave', this.stopResize.bind(this)); 140 this.node.addEventListener('mouseleave', this.stopResize.bind(this));
142
143 const webViewInstance = this;
144 this.webview.addEventListener('dom-ready', () => {
145 webViewInstance.webview.setUserAgent(userAgent(true));
146 });
147 } 141 }
148 142
149 startResize = (event) => { 143 startResize = (event) => {
@@ -214,6 +208,7 @@ class TodosWebview extends Component {
214 classes, 208 classes,
215 isTodosServiceActive, 209 isTodosServiceActive,
216 isVisible, 210 isVisible,
211 userAgent,
217 isTodosIncludedInCurrentPlan, 212 isTodosIncludedInCurrentPlan,
218 stores, 213 stores,
219 } = this.props; 214 } = this.props;
@@ -275,6 +270,7 @@ class TodosWebview extends Component {
275 partition={TODOS_PARTITION_ID} 270 partition={TODOS_PARTITION_ID}
276 preload="./features/todos/preload.js" 271 preload="./features/todos/preload.js"
277 ref={(webview) => { this.webview = webview ? webview.view : null; }} 272 ref={(webview) => { this.webview = webview ? webview.view : null; }}
273 useragent={userAgent}
278 src={todoUrl} 274 src={todoUrl}
279 /> 275 />
280 ) 276 )