mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-09-19 17:50:13 +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:
@@ -16,6 +16,7 @@ import {
|
||||
import { useCommand } from "@/hooks/use-command";
|
||||
import { useTheme } from "@/hooks/use-theme";
|
||||
import { useWebSocketContext } from "@/hooks/use-websocket-context";
|
||||
import { saveMainPageScrollPosition } from "@/lib/navigation";
|
||||
import { formatNezhaInfo } from "@/lib/utils";
|
||||
|
||||
export function DashCommand() {
|
||||
@@ -89,6 +90,7 @@ export function DashCommand() {
|
||||
key={server.id}
|
||||
value={server.name}
|
||||
onSelect={() => {
|
||||
saveMainPageScrollPosition();
|
||||
navigate(`/server/${server.id}`);
|
||||
closeCommand();
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user