Skip to content

Commit

Permalink
fix(web): ensure rollup address query parameter stays consistent with…
Browse files Browse the repository at this point in the history
… rollup filter dropdown value
  • Loading branch information
PJColombo committed Aug 30, 2024
1 parent 390c8cb commit 99346ad
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/web/src/components/Filters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ import type { FC } from "react";
import { useRouter } from "next/router";
import type { UrlObject } from "url";

import { getRollupByAddress } from "@blobscan/rollups";

import { Button } from "~/components/Button";
import { env } from "~/env.mjs";
import { useQueryParams } from "~/hooks/useQueryParams";
import { getChainIdByName } from "~/utils";
import type { Option } from "../Dropdown";
import { ROLLUP_OPTIONS, RollupFilter } from "./RollupFilter";

Expand Down Expand Up @@ -36,9 +40,10 @@ export const Filters: FC = function () {
};

useEffect(() => {
if (queryParams.rollup) {
if (queryParams.rollup || queryParams.from) {
const rollupOption = ROLLUP_OPTIONS.find(
(opt) => opt.value === queryParams.rollup
(opt) =>
opt.value === queryParams.rollup || opt.value === queryParams.from
);

if (rollupOption) {
Expand Down

0 comments on commit 99346ad

Please sign in to comment.