diff --git a/src/app.tsx b/src/app.tsx index 21fa057..dc99a30 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -65,8 +65,6 @@ const App = () => { intervalMultiplier, intervalMultiplierType, }); - - refreshData(); } catch (error) { console.error('Error Saving Practice Data', error); } diff --git a/src/components/overlay/PracticeOverlay.tsx b/src/components/overlay/PracticeOverlay.tsx index 3308046..b72f0a3 100644 --- a/src/components/overlay/PracticeOverlay.tsx +++ b/src/components/overlay/PracticeOverlay.tsx @@ -127,7 +127,7 @@ const PracticeOverlay = ({ const isDueToday = dateUtils.daysBetween(nextDueDate, new Date()) === 0; const status = isNew ? 'new' : isDueToday ? 'dueToday' : hasNextDueDate ? 'pastDue' : null; - const { data: blockInfo } = useBlockInfo({ refUid: currentCardRefUid }); + const { blockInfo } = useBlockInfo({ refUid: currentCardRefUid }); const hasBlockChildren = !!blockInfo.children && !!blockInfo.children.length; const [showAnswers, setShowAnswers] = React.useState(false); const [hasCloze, setHasCloze] = React.useState(true); diff --git a/src/hooks/useBlockInfo.tsx b/src/hooks/useBlockInfo.tsx index b554f93..e933e86 100644 --- a/src/hooks/useBlockInfo.tsx +++ b/src/hooks/useBlockInfo.tsx @@ -10,14 +10,14 @@ const useBlockInfo = ({ refUid }) => { const fetch = async () => { const blockInfo = await fetchBlockInfo(refUid); - setBlockInfo(blockInfo); + setBlockInfo({ ...blockInfo, refUid }); }; fetch(); }, [refUid]); return { - data: blockInfo, + blockInfo, }; }; diff --git a/src/queries.ts b/src/queries.ts index 9e057ec..9b4c4d3 100644 --- a/src/queries.ts +++ b/src/queries.ts @@ -658,6 +658,8 @@ export interface BlockInfo { string: string; children: any[]; breadcrumbs: Breadcrumbs[]; + + refUid: string; } export interface Breadcrumbs { [index: number]: { uid: string; title: string };