Skip to content

Commit

Permalink
Update fetching status flags
Browse files Browse the repository at this point in the history
  • Loading branch information
noctillion committed Nov 20, 2023
1 parent b39f43a commit 8a038e5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/js/features/ingestion/lastIngestion.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ const reduceServiceDataTypes = (state: DataTypeState, { payload }: PayloadAction
...state.dataTypes,
...Object.fromEntries(payload.map((data) => [data.id, data])),
};
state.isFetchingKatsuData = false;
state.isFetchingGohanData = false;
};

// Create a slice to manage the state
Expand All @@ -55,8 +53,14 @@ const DataTypeStore = createSlice({
builder.addCase(fetchGohanData.pending, (state) => {
state.isFetchingGohanData = true;
});
builder.addCase(fetchKatsuData.fulfilled, reduceServiceDataTypes);
builder.addCase(fetchGohanData.fulfilled, reduceServiceDataTypes);
builder.addCase(fetchKatsuData.fulfilled, (state, action) => {
reduceServiceDataTypes(state, action);
state.isFetchingKatsuData = false;
});
builder.addCase(fetchGohanData.fulfilled, (state, action) => {
reduceServiceDataTypes(state, action);
state.isFetchingGohanData = false;
});
builder.addCase(fetchKatsuData.rejected, (state) => {
state.isFetchingKatsuData = false;
});
Expand Down

0 comments on commit 8a038e5

Please sign in to comment.