Skip to content

Commit 20b847b

Browse files
authored
Merge pull request #2150 from oasisprotocol/mz/eventPagesQueryParam-3
Avoid query param conflict in tx details view
2 parents b343489 + dceb143 commit 20b847b

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

.changelog/2150.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Avoid query param conflict in tx details view

src/app/pages/RuntimeTransactionDetailPage/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export const RuntimeTransactionDetailView: FC<{
146146
offset: 0,
147147
}
148148
: undefined,
149+
'workaroundQueryParamOverwrittenByOffset',
149150
)
150151
const transfers = transferEventsQuery?.results?.data
151152
const totalTransfers = transferEventsQuery?.results?.tablePaginationProps?.totalCount

src/app/pages/TokenDashboardPage/hook.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const useNFTInstanceTransfers = (
5151
export const useTokenTransfers = (
5252
scope: undefined | RuntimeScope,
5353
params: undefined | GetRuntimeEventsParams,
54+
querySearchParamName?: string,
5455
) => {
5556
if (params && Object.values(params).some(value => value === undefined || value === null)) {
5657
throw new Error('Must set params=undefined while some values are unavailable')
@@ -61,7 +62,7 @@ export const useTokenTransfers = (
6162
const mockScopeForDisabledQuery = { network: 'mainnet', layer: 'sapphire' } as const
6263

6364
const pagination = useComprehensiveSearchParamsPagination<RuntimeEvent, RuntimeEventList>({
64-
paramName: 'page',
65+
paramName: querySearchParamName ?? 'page',
6566
pageSize: NUMBER_OF_ITEMS_ON_SEPARATE_PAGE,
6667
})
6768
const query = useGetRuntimeEvents(

0 commit comments

Comments
 (0)