diff --git a/src/components/SaveStoryButton/SaveStoryButton.tsx b/src/components/SaveStoryButton/SaveStoryButton.tsx index 9aded23..c4d4331 100644 --- a/src/components/SaveStoryButton/SaveStoryButton.tsx +++ b/src/components/SaveStoryButton/SaveStoryButton.tsx @@ -31,7 +31,7 @@ export default function SaveStoryButton({ storyId }: SaveStoryButtonProps) { useEffect(() => { // if another card updates this story, update it here also if (typeof channels[storyId] !== 'undefined') { - setStoryIsSaved(channels[storyId]); + setStoryIsSaved(channels[storyId] ?? false); } }, [channels[storyId]]); diff --git a/src/utils/PubSubContext.tsx b/src/utils/PubSubContext.tsx index ffc4c1d..fbb9ada 100644 --- a/src/utils/PubSubContext.tsx +++ b/src/utils/PubSubContext.tsx @@ -1,7 +1,7 @@ import React, { createContext, useContext, useMemo, useState } from 'react'; export interface PubSubState { - channels: Record; + channels: Record; initializeChannel: (id: number) => void; publish: (id: number, message: boolean) => void; }