Skip to content

Commit

Permalink
fix: Align the tree correctly when the layouts are switched
Browse files Browse the repository at this point in the history
  • Loading branch information
PintoGideon committed Apr 26, 2024
1 parent 9202dca commit 13a96db
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/FeedTree/FeedTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,15 @@ const FeedTree = (props: OwnProps) => {
React.useEffect(() => {
//@ts-ignore
if (size?.width) {
//@ts-ignore
dispatch(setTranslate({ x: size.width / 2, y: 90 }));
if (orientation === "vertical") {
//@ts-ignore
dispatch(setTranslate({ x: size.width / 2, y: 90 }));
} else {
//@ts-ignore
dispatch(setTranslate({ x: 180, y: size.height / 3 }));
}
}
}, [size, dispatch]);
}, [size, orientation, dispatch]);

const mode = useTypedSelector((state) => state.tsPlugins.treeMode);
const [feedState, setFeedState] = React.useState<FeedTreeState>(
Expand Down

0 comments on commit 13a96db

Please sign in to comment.