Skip to content

πŸ™Œ OpenHands: AI-Driven Development

472 B
Raw Blame
import { shouldRenderEvent } from "#/components/conversation-events/chat/event-content-helpers/should-render-event";
import { useEventStore } from "#/stores/use-event-store";

export const getLastRenderableEventId = (): string | null => {
  const { uiEvents } = useEventStore.getState();

  for (let index = uiEvents.length - 1; index >= 0; index -= 1) {
    const event = uiEvents[index];
    if (shouldRenderEvent(event)) return String(event.id);
  }

  return null;
};