diff options
author | 2019-10-24 15:15:42 +0200 | |
---|---|---|
committer | 2019-10-24 15:15:42 +0200 | |
commit | 54f8b191a94bd78a85b046bbf21dd2245d3a6f3e (patch) | |
tree | ada5876f0e8a697ba4693bba07f5e0f31fea1fc9 /src/containers/subscription | |
parent | Update submodules (diff) | |
parent | bump version to 5.4.0 (diff) | |
download | ferdium-app-54f8b191a94bd78a85b046bbf21dd2245d3a6f3e.tar.gz ferdium-app-54f8b191a94bd78a85b046bbf21dd2245d3a6f3e.tar.zst ferdium-app-54f8b191a94bd78a85b046bbf21dd2245d3a6f3e.zip |
Merge https://github.com/meetfranz/franz into franz-5.4.0-release
Diffstat (limited to 'src/containers/subscription')
-rw-r--r-- | src/containers/subscription/SubscriptionFormScreen.js | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/containers/subscription/SubscriptionFormScreen.js b/src/containers/subscription/SubscriptionFormScreen.js index 726b10628..38e46a7ba 100644 --- a/src/containers/subscription/SubscriptionFormScreen.js +++ b/src/containers/subscription/SubscriptionFormScreen.js | |||
@@ -1,4 +1,5 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import { remote } from 'electron'; | ||
2 | import PropTypes from 'prop-types'; | 3 | import PropTypes from 'prop-types'; |
3 | import { inject, observer } from 'mobx-react'; | 4 | import { inject, observer } from 'mobx-react'; |
4 | 5 | ||
@@ -7,11 +8,21 @@ import PaymentStore from '../../stores/PaymentStore'; | |||
7 | import SubscriptionForm from '../../components/subscription/SubscriptionForm'; | 8 | import SubscriptionForm from '../../components/subscription/SubscriptionForm'; |
8 | import TrialForm from '../../components/subscription/TrialForm'; | 9 | import TrialForm from '../../components/subscription/TrialForm'; |
9 | 10 | ||
11 | const { BrowserWindow } = remote; | ||
12 | |||
10 | export default @inject('stores', 'actions') @observer class SubscriptionFormScreen extends Component { | 13 | export default @inject('stores', 'actions') @observer class SubscriptionFormScreen extends Component { |
14 | static propTypes = { | ||
15 | onCloseWindow: PropTypes.func, | ||
16 | } | ||
17 | |||
18 | static defaultProps = { | ||
19 | onCloseWindow: () => null, | ||
20 | } | ||
21 | |||
11 | async openBrowser() { | 22 | async openBrowser() { |
12 | const { | 23 | const { |
13 | actions, | ||
14 | stores, | 24 | stores, |
25 | onCloseWindow, | ||
15 | } = this.props; | 26 | } = this.props; |
16 | 27 | ||
17 | const { | 28 | const { |
@@ -22,7 +33,24 @@ export default @inject('stores', 'actions') @observer class SubscriptionFormScre | |||
22 | let hostedPageURL = features.features.planSelectionURL; | 33 | let hostedPageURL = features.features.planSelectionURL; |
23 | hostedPageURL = user.getAuthURL(hostedPageURL); | 34 | hostedPageURL = user.getAuthURL(hostedPageURL); |
24 | 35 | ||
25 | actions.app.openExternalUrl({ url: hostedPageURL }); | 36 | const paymentWindow = new BrowserWindow({ |
37 | parent: remote.getCurrentWindow(), | ||
38 | modal: true, | ||
39 | title: '🔒 Franz Supporter License', | ||
40 | width: 800, | ||
41 | height: window.innerHeight - 100, | ||
42 | maxWidth: 800, | ||
43 | minWidth: 600, | ||
44 | webPreferences: { | ||
45 | nodeIntegration: true, | ||
46 | webviewTag: true, | ||
47 | }, | ||
48 | }); | ||
49 | paymentWindow.loadURL(`file://${__dirname}/../../index.html#/payment/${encodeURIComponent(hostedPageURL)}`); | ||
50 | |||
51 | paymentWindow.on('closed', () => { | ||
52 | onCloseWindow(); | ||
53 | }); | ||
26 | } | 54 | } |
27 | 55 | ||
28 | render() { | 56 | render() { |