mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-11-05 01:10:20 +00:00
Implement scroll position management for navigation (#73)
* feat: implement scroll position management for main page navigation * fix: import saveMainPageScrollPosition in ServerCard and ServerCardInline components * feat: save scroll position when navigating to server from DashCommand * fix: prevent restoring stale scroll positions without main page origin
This commit is contained in:
19 files changed
+218
-34
No files matched your search
@@ -8,6 +8,7 @@ import {
|
||||
GetOsName,
|
||||
MageMicrosoftWindows,
|
||||
} from "@/lib/logo-class";
|
||||
import { saveMainPageScrollPosition } from "@/lib/navigation";
|
||||
import { cn, formatNezhaInfo, parsePublicNote } from "@/lib/utils";
|
||||
import type { NezhaServer } from "@/types/nezha-api";
|
||||
import BillingInfo from "./billingInfo";
|
||||
@@ -41,7 +42,7 @@ export default function ServerCardInline({
|
||||
} = formatNezhaInfo(now, serverInfo);
|
||||
|
||||
const cardClick = () => {
|
||||
sessionStorage.setItem("fromMainPage", "true");
|
||||
saveMainPageScrollPosition();
|
||||
navigate(`/server/${serverInfo.id}`);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user