aboutsummaryrefslogtreecommitdiffstats
path: root/src/containers
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2018-01-17 19:54:28 +0400
committerLibravatar GitHub <noreply@github.com>2018-01-17 19:54:28 +0400
commitca35c63021b3ace29d1235c28ed0f76aaf4b1322 (patch)
tree70ca3fa325ab739d97ecfcb0e8548bce1c34ce0f /src/containers
parentMerge branch 'develop' of github.com:meetfranz/franz into develop (diff)
parentFix linting issues (diff)
downloadferdium-app-ca35c63021b3ace29d1235c28ed0f76aaf4b1322.tar.gz
ferdium-app-ca35c63021b3ace29d1235c28ed0f76aaf4b1322.tar.zst
ferdium-app-ca35c63021b3ace29d1235c28ed0f76aaf4b1322.zip
Merge pull request #587 from meetfranz/feature/remove-miner
[PR] Remove mining feature to get access to premium features
Diffstat (limited to 'src/containers')
-rw-r--r--src/containers/settings/AccountScreen.js12
-rw-r--r--src/containers/ui/SubscriptionFormScreen.js55
2 files changed, 23 insertions, 44 deletions
diff --git a/src/containers/settings/AccountScreen.js b/src/containers/settings/AccountScreen.js
index 008c495d4..c5c2982b0 100644
--- a/src/containers/settings/AccountScreen.js
+++ b/src/containers/settings/AccountScreen.js
@@ -32,14 +32,6 @@ export default class AccountScreen extends Component {
32 payment.plansRequest.reload(); 32 payment.plansRequest.reload();
33 } 33 }
34 34
35 stopMiner() {
36 const { update } = this.props.actions.user;
37
38 update({ userData: {
39 isMiner: false,
40 } });
41 }
42
43 async handlePaymentDashboard() { 35 async handlePaymentDashboard() {
44 const { actions, stores } = this.props; 36 const { actions, stores } = this.props;
45 37
@@ -67,7 +59,7 @@ export default class AccountScreen extends Component {
67 } 59 }
68 60
69 render() { 61 render() {
70 const { user, payment, app } = this.props.stores; 62 const { user, payment } = this.props.stores;
71 const { openExternalUrl } = this.props.actions.app; 63 const { openExternalUrl } = this.props.actions.app;
72 const { user: userActions } = this.props.actions; 64 const { user: userActions } = this.props.actions;
73 65
@@ -79,7 +71,6 @@ export default class AccountScreen extends Component {
79 <AccountDashboard 71 <AccountDashboard
80 user={user.data} 72 user={user.data}
81 orders={payment.orders} 73 orders={payment.orders}
82 hashrate={app.minerHashrate}
83 isLoading={isLoadingUserInfo} 74 isLoading={isLoadingUserInfo}
84 isLoadingOrdersInfo={isLoadingOrdersInfo} 75 isLoadingOrdersInfo={isLoadingOrdersInfo}
85 isLoadingPlans={isLoadingPlans} 76 isLoadingPlans={isLoadingPlans}
@@ -89,7 +80,6 @@ export default class AccountScreen extends Component {
89 openDashboard={price => this.handlePaymentDashboard(price)} 80 openDashboard={price => this.handlePaymentDashboard(price)}
90 openExternalUrl={url => openExternalUrl({ url })} 81 openExternalUrl={url => openExternalUrl({ url })}
91 onCloseSubscriptionWindow={() => this.onCloseWindow()} 82 onCloseSubscriptionWindow={() => this.onCloseWindow()}
92 stopMiner={() => this.stopMiner()}
93 deleteAccount={userActions.delete} 83 deleteAccount={userActions.delete}
94 isLoadingDeleteAccount={user.deleteAccountRequest.isExecuting} 84 isLoadingDeleteAccount={user.deleteAccountRequest.isExecuting}
95 isDeleteAccountSuccessful={user.deleteAccountRequest.wasExecuted && !user.deleteAccountRequest.isError} 85 isDeleteAccountSuccessful={user.deleteAccountRequest.wasExecuted && !user.deleteAccountRequest.isError}
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