Skip to content

Commit 99d1c01

Browse files
committed
fix(Onboarding): Fix service import
Fixes #22
1 parent 23174f9 commit 99d1c01

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/stores/UserStore.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,15 @@ export default class UserStore extends Store {
192192
@action async _importLegacyServices({ services }) {
193193
this.isImportLegacyServicesExecuting = true;
194194

195+
// Reduces recipe duplicates
196+
const recipes = services.filter((obj, pos, arr) => arr.map(mapObj => mapObj.recipe.id).indexOf(obj.recipe.id) === pos).map(s => s.recipe.id);
197+
198+
// Install recipes
199+
for (const recipe of recipes) {
200+
// eslint-disable-next-line
201+
await this.stores.recipes._install({ recipeId: recipe });
202+
}
203+
195204
for (const service of services) {
196205
this.actions.service.createFromLegacyService({
197206
data: service,

0 commit comments

Comments
 (0)