From 0b08e1e7e6a07acd21af71fd27f4c4acfa34dbba Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Wed, 16 Oct 2019 15:16:26 +0200 Subject: Add trialStatusBar & polishing --- src/features/planSelection/store.js | 40 ++++--------------------------------- 1 file changed, 4 insertions(+), 36 deletions(-) (limited to 'src/features/planSelection/store.js') diff --git a/src/features/planSelection/store.js b/src/features/planSelection/store.js index e229c37e5..0d4672722 100644 --- a/src/features/planSelection/store.js +++ b/src/features/planSelection/store.js @@ -42,7 +42,6 @@ export default class PlanSelectionStore extends FeatureStore { // ACTIONS this._registerActions(createActionBindings([ - [planSelectionActions.upgradeAccount, this._upgradeAccount], [planSelectionActions.downgradeAccount, this._downgradeAccount], [planSelectionActions.hideOverlay, this._hideOverlay], ])); @@ -64,47 +63,12 @@ export default class PlanSelectionStore extends FeatureStore { @action stop() { super.stop(); debug('PlanSelectionStore::stop'); - this.reset(); this.isFeatureActive = false; } // ========== PRIVATE METHODS ========= // // Actions - - @action _upgradeAccount = ({ planId, onCloseWindow = () => null }) => { - let hostedPageURL = this.stores.features.features.subscribeURL; - - const parsedUrl = new URL(hostedPageURL); - const params = new URLSearchParams(parsedUrl.search.slice(1)); - - params.set('plan', planId); - - hostedPageURL = this.stores.user.getAuthURL(`${parsedUrl.origin}${parsedUrl.pathname}?${params.toString()}`); - - const win = new BrowserWindow({ - parent: remote.getCurrentWindow(), - modal: true, - title: '🔒 Upgrade Your Franz Account', - width: 800, - height: window.innerHeight - 100, - maxWidth: 800, - minWidth: 600, - webPreferences: { - nodeIntegration: true, - webviewTag: true, - }, - }); - win.loadURL(`file://${__dirname}/../../index.html#/payment/${encodeURIComponent(hostedPageURL)}`); - - win.on('closed', () => { - this.stores.user.getUserInfoRequest.invalidate({ immediately: true }); - this.stores.features.featuresRequest.invalidate({ immediately: true }); - - onCloseWindow(); - }); - }; - @action _downgradeAccount = () => { downgradeUserRequest.execute(); } @@ -112,4 +76,8 @@ export default class PlanSelectionStore extends FeatureStore { @action _hideOverlay = () => { this.hideOverlay = true; } + + @action _showOverlay = () => { + this.hideOverlay = false; + } } -- cgit v1.2.3-70-g09d2