Skip to content

Commit

Permalink
fix(Onboarding): Fix service import
Browse files Browse the repository at this point in the history
Fixes #22
  • Loading branch information
adlk committed Oct 22, 2017
1 parent 23174f9 commit 99d1c01
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/stores/UserStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@ export default class UserStore extends Store {
@action async _importLegacyServices({ services }) {
this.isImportLegacyServicesExecuting = true;
// Reduces recipe duplicates
const recipes = services.filter((obj, pos, arr) => arr.map(mapObj => mapObj.recipe.id).indexOf(obj.recipe.id) === pos).map(s => s.recipe.id);
// Install recipes
for (const recipe of recipes) {
// eslint-disable-next-line
await this.stores.recipes._install({ recipeId: recipe });
}
for (const service of services) {
this.actions.service.createFromLegacyService({
data: service,
Expand Down

0 comments on commit 99d1c01

Please sign in to comment.