Skip to content

Commit

Permalink
Merge pull request janus-idp#67 from parodos-dev/fixStatusOfProjectsS…
Browse files Browse the repository at this point in the history
…lice

Fix state reporting of fetchProjects()
  • Loading branch information
mareklibra authored Mar 27, 2023
2 parents 48fe47d + ecf24b9 commit d45a732
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/parodos/src/stores/slices/projectsSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const createProjectsSlice: StateCreator<
projects: [],
async fetchProjects() {
set(state => {
state.workflowLoading = true;
state.projectsLoading = true;
});

try {
Expand All @@ -31,8 +31,10 @@ export const createProjectsSlice: StateCreator<
});
});
} catch (e) {
// eslint-disable-next-line no-console
console.error('fetchProjects error: ', e);
set(state => {
state.workflowError = e;
state.projectsError = e as Error;
});
}
},
Expand Down
2 changes: 2 additions & 0 deletions plugins/parodos/src/stores/slices/workflowSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export const createWorkflowSlice: StateCreator<
});
});
} catch (e) {
// eslint-disable-next-line no-console
console.error('fetchDefinitions error: ', e);
set(state => {
state.workflowError = e;
});
Expand Down

0 comments on commit d45a732

Please sign in to comment.