Skip to content

Commit

Permalink
fix: gql with utc (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuash committed Jan 19, 2022
1 parent f792beb commit 7bd6df7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

## Bug fixes
- Fix home page validator image url not displaying correctly ([\#632](https://github.com/forbole/big-dipper-2.0-cosmos/issues/632))
- Fix validator anc account details possible infinite load due to dayjs in hook

## Migration

Expand Down
4 changes: 3 additions & 1 deletion src/screens/account_details/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ const initialState: AccountDetailState = {
},
};

const UTC_NOW = dayjs.utc().format('YYYY-MM-DDTHH:mm:ss');

export const useAccountDetails = () => {
const router = useRouter();
const [state, setState] = useState<AccountDetailState>(initialState);
Expand Down Expand Up @@ -108,7 +110,7 @@ export const useAccountDetails = () => {
useAccountQuery({
variables: {
address: R.pathOr('', ['query', 'address'], router),
utc: dayjs.utc().format('YYYY-MM-DDTHH:mm:ss'),
utc: UTC_NOW,
},
onCompleted: (data) => {
handleSetState(formatAccountQuery(data));
Expand Down
4 changes: 3 additions & 1 deletion src/screens/validator_details/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ const initialState: ValidatorDetailsState = {
},
};

const UTC_NOW = dayjs.utc().format('YYYY-MM-DDTHH:mm:ss');

export const useValidatorDetails = () => {
const router = useRouter();
const [state, setState] = useState<ValidatorDetailsState>(initialState);
Expand Down Expand Up @@ -118,7 +120,7 @@ export const useValidatorDetails = () => {
useValidatorDetailsQuery({
variables: {
address: R.pathOr('', ['query', 'address'], router),
utc: dayjs.utc().format('YYYY-MM-DDTHH:mm:ss'),
utc: UTC_NOW,
},
onCompleted: (data) => {
handleSetState(formatAccountQuery(data));
Expand Down

0 comments on commit 7bd6df7

Please sign in to comment.