Skip to content

Commit 6034ea3

Browse files
Fix expansion state tracking in Server Notifications
1 parent 21fd2f9 commit 6034ea3

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

client/src/components/History.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,27 @@ const HistoryAndNotifications = ({
110110
>
111111
<div
112112
className="flex justify-between items-center cursor-pointer"
113-
onClick={() => toggleNotificationExpansion(index)}
113+
onClick={() =>
114+
toggleNotificationExpansion(
115+
serverNotifications.length - 1 - index,
116+
)
117+
}
114118
>
115119
<span className="font-mono">
116120
{serverNotifications.length - index}.{" "}
117121
{notification.method}
118122
</span>
119-
<span>{expandedNotifications[index] ? "▼" : "▶"}</span>
123+
<span>
124+
{expandedNotifications[
125+
serverNotifications.length - 1 - index
126+
]
127+
? "▼"
128+
: "▶"}
129+
</span>
120130
</div>
121-
{expandedNotifications[index] && (
131+
{expandedNotifications[
132+
serverNotifications.length - 1 - index
133+
] && (
122134
<div className="mt-2">
123135
<div className="flex justify-between items-center mb-1">
124136
<span className="font-semibold text-purple-600">

0 commit comments

Comments
 (0)