Skip to content

Commit

Permalink
add places where announcement might need to be defined
Browse files Browse the repository at this point in the history
  • Loading branch information
anakaren-rojas committed Dec 10, 2024
1 parent c9c5c6c commit 3ea27e2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export function renderPointGraph(
state: PointGraphState,
dispatch: Dispatch,
): InteractiveGraphElementSuite {
// this is also needed here otherwise announcement is undefined
state.announcement = {text: ""};
return {
graph: <PointGraph graphState={state} dispatch={dispatch} />,
interactiveElementsDescription: <PointGraphDescription state={state} />,
Expand All @@ -47,6 +49,7 @@ function LimitedPointGraph(props: PointGraphProps) {
const {announcement} = graphState;

// Announcement would get updated here
graphState.announcement = {text: "I'm an announcement"};

React.useEffect(() => {
if (announcement && announcement.text) {
Expand Down

0 comments on commit 3ea27e2

Please sign in to comment.