aboutsummaryrefslogtreecommitdiffstats
path: root/src/containers/ui/SubscriptionFormScreen.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/containers/ui/SubscriptionFormScreen.js')
-rw-r--r--src/containers/ui/SubscriptionFormScreen.js55
1 files changed, 22 insertions, 33 deletions
diff --git a/src/containers/ui/SubscriptionFormScreen.js b/src/containers/ui/SubscriptionFormScreen.js
index d08507809..ac4593670 100644
--- a/src/containers/ui/SubscriptionFormScreen.js
+++ b/src/containers/ui/SubscriptionFormScreen.js
@@ -34,47 +34,36 @@ export default class SubscriptionFormScreen extends Component {
34 actions, 34 actions,
35 stores, 35 stores,
36 onCloseWindow, 36 onCloseWindow,
37 skipAction,
38 } = this.props; 37 } = this.props;
39 38
40 if (plan !== 'mining') { 39 const interval = plan;
41 const interval = plan;
42
43 const { id } = stores.payment.plan[interval];
44 actions.payment.createHostedPage({
45 planId: id,
46 });
47 40
48 const hostedPage = await stores.payment.createHostedPageRequest; 41 const { id } = stores.payment.plan[interval];
49 const url = `file://${__dirname}/../../index.html#/payment/${encodeURIComponent(hostedPage.url)}`; 42 actions.payment.createHostedPage({
43 planId: id,
44 });
50 45
51 if (hostedPage.url) { 46 const hostedPage = await stores.payment.createHostedPageRequest;
52 const paymentWindow = new BrowserWindow({ 47 const url = `file://${__dirname}/../../index.html#/payment/${encodeURIComponent(hostedPage.url)}`;
53 parent: remote.getCurrentWindow(),
54 modal: true,
55 title: '🔒 Franz Supporter License',
56 width: 600,
57 height: window.innerHeight - 100,
58 maxWidth: 600,
59 minWidth: 600,
60 webPreferences: {
61 nodeIntegration: true,
62 },
63 });
64 paymentWindow.loadURL(url);
65 48
66 paymentWindow.on('closed', () => { 49 if (hostedPage.url) {
67 onCloseWindow(); 50 const paymentWindow = new BrowserWindow({
68 }); 51 parent: remote.getCurrentWindow(),
69 } 52 modal: true,
70 } else { 53 title: '🔒 Franz Supporter License',
71 actions.user.update({ 54 width: 600,
72 userData: { 55 height: window.innerHeight - 100,
73 isMiner: true, 56 maxWidth: 600,
57 minWidth: 600,
58 webPreferences: {
59 nodeIntegration: true,
74 }, 60 },
75 }); 61 });
62 paymentWindow.loadURL(url);
76 63
77 skipAction(); 64 paymentWindow.on('closed', () => {
65 onCloseWindow();
66 });
78 } 67 }
79 } 68 }
80 69