diff --git a/web/components/TableList/ColumnList/index.tsx b/web/components/TableList/ColumnList/index.tsx index 69e661d9..0e10ee9d 100644 --- a/web/components/TableList/ColumnList/index.tsx +++ b/web/components/TableList/ColumnList/index.tsx @@ -66,7 +66,7 @@ function ColumnItem({ col }: { col: ColumnForTableListFragment }) { ); } -const collateRegex = /COLLATE UTF8MB4_0900_(AI_CI|BIN)/; +const collateRegex = /\s+COLLATE\s+\w+/i; function getConstraints(c: Column): string { return c.constraints?.some(con => con.notNull) ? " NOT NULL" : ""; diff --git a/web/components/pageComponents/DatabasePage/ForCommits/CommitLog/index.tsx b/web/components/pageComponents/DatabasePage/ForCommits/CommitLog/index.tsx index e2c35ed2..c7572c46 100644 --- a/web/components/pageComponents/DatabasePage/ForCommits/CommitLog/index.tsx +++ b/web/components/pageComponents/DatabasePage/ForCommits/CommitLog/index.tsx @@ -5,6 +5,7 @@ import { CommitForHistoryFragment } from "@gen/graphql-types"; import { useCommitListForBranch } from "@hooks/useCommitListForBranch"; import { RefParams } from "@lib/params"; import { useRouter } from "next/router"; +import { useEffect, useState } from "react"; import InfiniteScroll from "react-infinite-scroller"; import CommitGraphButton from "./CommitGraphButton"; import CommitHeader from "./CommitHeader"; @@ -26,6 +27,22 @@ function Inner({ commits, ...props }: InnerProps) { const router = useRouter(); useAnchorTag(); const { isMobile } = useReactiveWidth(1024); + const [activeHash, setActiveHash] = useState( + router.asPath.split("#")[1] || "", + ); + + useEffect(() => { + const handleHashChange = () => { + const hash = window.location.hash.replace("#", ""); + setActiveHash(hash); + }; + + window.addEventListener("hashchange", handleHashChange, false); + + return () => { + window.removeEventListener("hashchange", handleHashChange, false); + }; + }, []); return (
@@ -63,7 +80,7 @@ function Inner({ commits, ...props }: InnerProps) { {...props} key={c._id} commit={c} - activeHash={router.asPath.split("#")[1]} + activeHash={activeHash} /> );