mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-09 12:13:10 -05:00
router replace instead of router push
This commit is contained in:
parent
2e8e027ae7
commit
f9f17a7d37
|
|
@ -162,23 +162,22 @@ const AvatarWithInfo: React.FC<AvatarWithInfoProps> = ({
|
|||
</Flex>
|
||||
)}
|
||||
|
||||
{process.env.NODE_ENV === "development" &&
|
||||
Object.keys(peakLeaguePowers).length > 0 && (
|
||||
<Flex mt={4}>
|
||||
{(["TWIN", "QUAD"] as LeagueType[])
|
||||
.filter((type) => peakLeaguePowers[type])
|
||||
.map((type) => (
|
||||
<Fragment key={type}>
|
||||
<Flex align="center" justify="center" mx={2}>
|
||||
<Box ml={2} color={gray}>
|
||||
<SubText>{type}</SubText>
|
||||
{peakLeaguePowers[type]}
|
||||
</Box>
|
||||
</Flex>
|
||||
</Fragment>
|
||||
))}
|
||||
</Flex>
|
||||
)}
|
||||
{Object.keys(peakLeaguePowers).length > 0 && (
|
||||
<Flex mt={4}>
|
||||
{(["TWIN", "QUAD"] as LeagueType[])
|
||||
.filter((type) => peakLeaguePowers[type])
|
||||
.map((type) => (
|
||||
<Fragment key={type}>
|
||||
<Flex align="center" justify="center" mx={2}>
|
||||
<Box ml={2} color={gray}>
|
||||
<SubText>{type}</SubText>
|
||||
{peakLeaguePowers[type]}
|
||||
</Box>
|
||||
</Flex>
|
||||
</Fragment>
|
||||
))}
|
||||
</Flex>
|
||||
)}
|
||||
<Box width="100%" textAlign="center" mt={4}>
|
||||
{!!user.player?.switchAccountId && (
|
||||
<MyLink
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import "./styles.css";
|
|||
NProgress.configure({ showSpinner: false });
|
||||
|
||||
Router.events.on("routeChangeStart", (url) => {
|
||||
console.log(`Loading: ${url}`);
|
||||
NProgress.start();
|
||||
});
|
||||
Router.events.on("routeChangeComplete", () => NProgress.done());
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ const PlayerPage = (props: Props) => {
|
|||
|
||||
<RadioGroup
|
||||
onChange={(value) => {
|
||||
router.push(
|
||||
router.replace(
|
||||
`/player/${player.switchAccountId}/?tab=${value}`,
|
||||
undefined,
|
||||
{
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ const UserSearchPage = ({ users }: Props) => {
|
|||
|
||||
useEffect(() => {
|
||||
if (debouncedFilter.length < 3) {
|
||||
router.push(`/u`, undefined, { shallow: true });
|
||||
router.replace(`/u`, undefined, { shallow: true });
|
||||
} else {
|
||||
router.push(
|
||||
router.replace(
|
||||
`/u?filter=${encodeURIComponent(debouncedFilter)}`,
|
||||
undefined,
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ const XSearchPage = ({ placements, monthOptions }: Props) => {
|
|||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
router.push(
|
||||
router.replace(
|
||||
`/xsearch/${variables.year}/${variables.month}/${variables.mode}`
|
||||
);
|
||||
}, [variables]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user