mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-19 12:00:32 +02:00
fix small issue with routing in drawer
This commit is contained in:
@@ -122,7 +122,7 @@ export default function DrawerSubViewProvider({
|
|||||||
} else if (direction.current !== "down") {
|
} else if (direction.current !== "down") {
|
||||||
log("Updating parent state from Router");
|
log("Updating parent state from Router");
|
||||||
direction.current = "up";
|
direction.current = "up";
|
||||||
parentRouter.navigate(".", {
|
parentRouter.navigate(parentRouter.state.location, {
|
||||||
preventScrollReset: true,
|
preventScrollReset: true,
|
||||||
state: { ...parentRouter.state.location.state, subRouterPath: e.location.pathname },
|
state: { ...parentRouter.state.location.state, subRouterPath: e.location.pathname },
|
||||||
});
|
});
|
||||||
@@ -145,7 +145,7 @@ export default function DrawerSubViewProvider({
|
|||||||
const openDrawer = useCallback(
|
const openDrawer = useCallback(
|
||||||
(to: To) => {
|
(to: To) => {
|
||||||
marker.current = 0;
|
marker.current = 0;
|
||||||
parentRouter.navigate(".", {
|
parentRouter.navigate(parentRouter.state.location, {
|
||||||
preventScrollReset: true,
|
preventScrollReset: true,
|
||||||
state: { ...parentRouter.state.location.state, subRouterPath: to },
|
state: { ...parentRouter.state.location.state, subRouterPath: to },
|
||||||
});
|
});
|
||||||
@@ -160,7 +160,7 @@ export default function DrawerSubViewProvider({
|
|||||||
parentRouter.navigate(-i);
|
parentRouter.navigate(-i);
|
||||||
} else {
|
} else {
|
||||||
log(`Failed to navigate back, clearing state`);
|
log(`Failed to navigate back, clearing state`);
|
||||||
parentRouter.navigate(".", {
|
parentRouter.navigate(parentRouter.state.location, {
|
||||||
preventScrollReset: true,
|
preventScrollReset: true,
|
||||||
state: { ...parentRouter.state.location.state, subRouterPath: undefined },
|
state: { ...parentRouter.state.location.state, subRouterPath: undefined },
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user