Fix expansion state tracking in Server Notifications

This commit is contained in:
Richard Michael 2025-06-14 22:31:30 -07:00
commit 6034ea36dc

View file

@ -110,15 +110,27 @@ const HistoryAndNotifications = ({
> >
<div <div
className="flex justify-between items-center cursor-pointer" className="flex justify-between items-center cursor-pointer"
onClick={() => toggleNotificationExpansion(index)} onClick={() =>
toggleNotificationExpansion(
serverNotifications.length - 1 - index,
)
}
> >
<span className="font-mono"> <span className="font-mono">
{serverNotifications.length - index}.{" "} {serverNotifications.length - index}.{" "}
{notification.method} {notification.method}
</span> </span>
<span>{expandedNotifications[index] ? "▼" : "▶"}</span> <span>
{expandedNotifications[
serverNotifications.length - 1 - index
]
? "▼"
: "▶"}
</span>
</div> </div>
{expandedNotifications[index] && ( {expandedNotifications[
serverNotifications.length - 1 - index
] && (
<div className="mt-2"> <div className="mt-2">
<div className="flex justify-between items-center mb-1"> <div className="flex justify-between items-center mb-1">
<span className="font-semibold text-purple-600"> <span className="font-semibold text-purple-600">