From bd1a515ef80b3e6de3c248597eee7bcd72ee74ab Mon Sep 17 00:00:00 2001 From: thislight Date: Sat, 17 Aug 2024 15:44:25 +0800 Subject: [PATCH] TimelinePanel: now can close expaneded toot --- src/timelines/Home.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/timelines/Home.tsx b/src/timelines/Home.tsx index 2bd5e34..b177b2d 100644 --- a/src/timelines/Home.tsx +++ b/src/timelines/Home.tsx @@ -146,7 +146,7 @@ const TimelinePanel: Component<{ expanded={item.id === expandedThreadId() ? 1 : 0} onExpandChange={(x) => { if (item.id !== expandedThreadId()) { - setExpandedThreadId(item.id); + setExpandedThreadId((x) => (x ? undefined : item.id)); } else if (x === 2) { props.openFullScreenToot(item, element); } @@ -205,8 +205,8 @@ const Home: ParentComponent = (props) => { } }; const client = () => { - const all = profiles() - return all?.[0]?.client + const all = profiles(); + return all?.[0]?.client; }; const navigate = useNavigate();