Skip to content

Commit

Permalink
fix: unable to fetch count due to tx expression, proposer width
Browse files Browse the repository at this point in the history
  • Loading branch information
poomthiti committed Apr 28, 2023
1 parent c973401 commit 8c97d02
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/lib/pages/block-details/components/BlockInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const BlockInfo = ({ blockData }: BlockInfoProps) => {
const [proposerWidth, setProposerWidth] = useState<number>();
const measuredRef = useCallback((node: HTMLDivElement | null) => {
if (node !== null) {
setProposerWidth(node.clientWidth);
setProposerWidth(node.scrollWidth);
}
}, []);
return (
Expand Down
26 changes: 16 additions & 10 deletions src/lib/services/expression/txExpression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,22 @@ export const useTxExpression = ({
filters: TxFilters;
isSigner: Option<boolean>;
}) =>
useMemo(
() => ({
useMemo(() => {
const hasFilter = Object.values(filters).some((filter: boolean) => filter);
return {
...(accountId
? { account_id: { _eq: accountId } }
: { account: { address: address ? { _eq: address } : {} } }),
is_signer: isSigner === undefined ? {} : { _eq: isSigner },
transaction: {
...generateActionsFilter(filters),
_or: generateSearch(search.toLocaleLowerCase()),
},
}),
[address, accountId, filters, isSigner, search]
);
...(isSigner === undefined ? {} : { is_signer: { _eq: isSigner } }),
...(hasFilter || search
? {
transaction: {
...(hasFilter ? generateActionsFilter(filters) : {}),
...(search
? { _or: generateSearch(search.toLocaleLowerCase()) }
: {}),
},
}
: {}),
};
}, [address, accountId, filters, isSigner, search]);

0 comments on commit 8c97d02

Please sign in to comment.