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