diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-06-12 15:16:56 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-06-12 15:16:56 +0200 |
commit | eba50bc5a41b8492c0350b73936405eab1b8c453 (patch) | |
tree | caac808d019f324fa970dfd721aeb2641dea6609 /src/stores/ServicesStore.js | |
parent | Update CHANGELOG.md (diff) | |
download | ferdium-app-eba50bc5a41b8492c0350b73936405eab1b8c453.tar.gz ferdium-app-eba50bc5a41b8492c0350b73936405eab1b8c453.tar.zst ferdium-app-eba50bc5a41b8492c0350b73936405eab1b8c453.zip |
fix(Recipes): Fix recipe install when directly accessing recipe
Diffstat (limited to 'src/stores/ServicesStore.js')
-rw-r--r-- | src/stores/ServicesStore.js | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index d63302fce..109ac5cd7 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -148,18 +148,7 @@ export default class ServicesStore extends Store { | |||
148 | } | 148 | } |
149 | 149 | ||
150 | async _showAddServiceInterface({ recipeId }) { | 150 | async _showAddServiceInterface({ recipeId }) { |
151 | const recipesStore = this.stores.recipes; | 151 | this.stores.router.push(`/settings/services/add/${recipeId}`); |
152 | |||
153 | if (recipesStore.isInstalled(recipeId)) { | ||
154 | debug(`Recipe ${recipeId} is installed`); | ||
155 | this._redirectToAddServiceRoute(recipeId); | ||
156 | } else { | ||
157 | debug(`Recipe ${recipeId} is not installed`); | ||
158 | // We access the RecipeStore action directly | ||
159 | // returns Promise instead of action | ||
160 | await this.stores.recipes._install({ recipeId }); | ||
161 | this._redirectToAddServiceRoute(recipeId); | ||
162 | } | ||
163 | } | 152 | } |
164 | 153 | ||
165 | // Actions | 154 | // Actions |
@@ -690,11 +679,6 @@ export default class ServicesStore extends Store { | |||
690 | } | 679 | } |
691 | 680 | ||
692 | // Helper | 681 | // Helper |
693 | _redirectToAddServiceRoute(recipeId) { | ||
694 | const route = `/settings/services/add/${recipeId}`; | ||
695 | this.stores.router.push(route); | ||
696 | } | ||
697 | |||
698 | _initializeServiceRecipeInWebview(serviceId) { | 682 | _initializeServiceRecipeInWebview(serviceId) { |
699 | const service = this.one(serviceId); | 683 | const service = this.one(serviceId); |
700 | 684 | ||