From 02ac0ee3ee5066100f8d41a16fa5f6f7055a5778 Mon Sep 17 00:00:00 2001 From: Richard Shiue <71320345+richardshiue@users.noreply.github.com> Date: Thu, 11 Sep 2025 20:04:13 +0800 Subject: [PATCH] fix: load view in useDatabaseOperations (#70) --- src/components/app/layers/AppBusinessLayer.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/app/layers/AppBusinessLayer.tsx b/src/components/app/layers/AppBusinessLayer.tsx index edfc6be3..229aff2e 100644 --- a/src/components/app/layers/AppBusinessLayer.tsx +++ b/src/components/app/layers/AppBusinessLayer.tsx @@ -65,9 +65,6 @@ export const AppBusinessLayer: React.FC = ({ children }) // Initialize page operations const pageOperations = usePageOperations({ outline, loadOutline }); - // Initialize database operations - const databaseOperations = useDatabaseOperations(loadView, createRowDoc); - // Check if current view has been deleted const viewHasBeenDeleted = useMemo(() => { if (!viewId) return false; @@ -207,6 +204,9 @@ export const AppBusinessLayer: React.FC = ({ children }) [pageOperations, loadTrash] ); + // Initialize database operations + const databaseOperations = useDatabaseOperations(enhancedLoadView, createRowDoc); + // Business context value const businessContextValue: BusinessInternalContextType = useMemo( () => ({