Skip to content

Commit

Permalink
fix: Initial fetching/loading state (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
aomafarag authored Dec 12, 2022
1 parent c82676e commit 89db7a2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion frontend/store/auctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ interface State {
const getInitialState = (): State => ({
auctionStorage: {},
takeEventStorage: {},
areAuctionsFetching: false,
areAuctionsFetching: true,
isSelectedAuctionFetching: false,
areTakeEventsFetching: false,
isBidding: false,
Expand Down Expand Up @@ -214,6 +214,7 @@ export const actions = {
return;
}
commit('setIsSelectedAuctionFetching', true);
commit('setAreAuctionsFetching', false);
try {
const auction = await fetchSingleAuctionById(network, auctionId);
commit('setAuction', auction);
Expand Down
2 changes: 1 addition & 1 deletion frontend/store/debt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface State {
const getInitialState = (): State => ({
auctionStorage: {},
auctionStates: {},
areAuctionsFetching: false,
areAuctionsFetching: true,
isAuthorizationLoading: false,
error: null,
lastUpdated: undefined,
Expand Down
2 changes: 1 addition & 1 deletion frontend/store/surplus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const getInitialState = (): State => ({
auctionStorage: {},
auctionStates: {},
allowanceAmount: undefined,
areAuctionsFetching: false,
areAuctionsFetching: true,
isAuthorizationLoading: false,
error: null,
lastUpdated: undefined,
Expand Down
5 changes: 4 additions & 1 deletion frontend/store/vaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface State {
const getInitialState = (): State => ({
vaultTransactions: {},
vaultErrors: {},
areVaultsLoading: false,
areVaultsLoading: true,
isVaultBeingLiquidated: false,
isVaultLiquidationDone: false,
lastUpdated: undefined,
Expand Down Expand Up @@ -88,6 +88,9 @@ export const actions = {
},
async fetchVault({ commit, rootGetters }: ActionContext<State, State>, vaultId: number) {
const network = rootGetters['network/getMakerNetwork'];
if (!network) {
return;
}
commit('setAreVaultsLoading', true);
try {
const vault = await fetchVault(network, vaultId);
Expand Down

0 comments on commit 89db7a2

Please sign in to comment.