Skip to content

Commit

Permalink
uncommented reducer
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-gonzalez-akkodis committed Jul 9, 2024
1 parent b0c9841 commit 55d8973
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions packages/core/src/state/hedger/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,33 +75,33 @@ export default createReducer(initialState, (builder) =>
console.error("Unable to fetch getMarketsDepth");
})

// .addCase(getMarkets.pending, (state) => {
// state.marketsStatus = ApiState.LOADING;
// })
// .addCase(getMarkets.fulfilled, (state, { payload }) => {
// state.markets = payload.markets;
// state.errorMessages = payload.errorMessages;
// state.marketsStatus = ApiState.OK;
// })
// .addCase(getMarkets.rejected, (state) => {
// state.markets = [];
// state.marketsStatus = ApiState.ERROR;
// state.errorMessages = {};
// console.error("Unable to fetch getMarkets", state);
// })
.addCase(getMarkets.pending, (state) => {
state.marketsStatus = ApiState.LOADING;
})
.addCase(getMarkets.fulfilled, (state, { payload }) => {
state.markets = payload.markets;
state.errorMessages = payload.errorMessages;
state.marketsStatus = ApiState.OK;
})
.addCase(getMarkets.rejected, (state) => {
state.markets = [];
state.marketsStatus = ApiState.ERROR;
state.errorMessages = {};
console.error("Unable to fetch getMarkets", state);
})

// .addCase(getOpenInterest.pending, (state) => {
// state.openInterestStatus = ApiState.LOADING;
// })
// .addCase(getOpenInterest.fulfilled, (state, { payload }) => {
// state.openInterest = payload.openInterest;
// state.openInterestStatus = ApiState.OK;
// })
// .addCase(getOpenInterest.rejected, (state) => {
// state.openInterestStatus = ApiState.ERROR;
// state.openInterest = { total: -1, used: -1 };
// console.error("Unable to fetch openInterest", state);
// })
.addCase(getOpenInterest.pending, (state) => {
state.openInterestStatus = ApiState.LOADING;
})
.addCase(getOpenInterest.fulfilled, (state, { payload }) => {
state.openInterest = payload.openInterest;
state.openInterestStatus = ApiState.OK;
})
.addCase(getOpenInterest.rejected, (state) => {
state.openInterestStatus = ApiState.ERROR;
state.openInterest = { total: -1, used: -1 };
console.error("Unable to fetch openInterest", state);
})

.addCase(getNotionalCap.pending, (state) => {
state.marketNotionalCapStatus = ApiState.LOADING;
Expand Down

0 comments on commit 55d8973

Please sign in to comment.