Skip to content

Commit

Permalink
Merge pull request #962 from oraichain/feat/add-route-cw20-accounts
Browse files Browse the repository at this point in the history
update path smart contract
  • Loading branch information
haunv3 authored Dec 19, 2023
2 parents 59a3f98 + 9e8b8e9 commit 6ee85c7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const TransactionCard = memo(({ address = "", account = "" }) => {
const [pageId, setPageId] = useState(1);
const isCw20Tab = window.location.search === "?cw20";
const initActiveTab = isCw20Tab ? 2 : 0;
if (!isCw20Tab && window.location.search) history.replace(`${consts.API.SMART_CONTRACT}/${address}`);
if (!isCw20Tab && window.location.search) history.replace(`${consts.PATH.SMART_CONTRACT}/${address}`);
const [activeTab, setActiveTab] = useState(initActiveTab);
const totalPagesRef = useRef(null);

Expand Down Expand Up @@ -67,8 +67,8 @@ const TransactionCard = memo(({ address = "", account = "" }) => {
paginationSection = totalPagesRef.current ? <Pagination pages={totalPagesRef.current} page={pageId} onChange={(e, page) => onPageChange(page)} /> : <></>;

const handleSetActiveTab = tabId => {
let str = `${consts.API.SMART_CONTRACT}/${address}`;
if (tabId) str += "?cw20";
let str = `${consts.PATH.SMART_CONTRACT}/${address}`;
if (tabId === 2) str += "?cw20";
history.replace(str);
setActiveTab(tabId);
};
Expand Down

0 comments on commit 6ee85c7

Please sign in to comment.