Browse Source

debug: add console logging for checkbox toggle issue #85

Claude 5 months ago
parent
commit
8815d652cc
1 changed files with 8 additions and 0 deletions
  1. 8 0
      shopcall.ai-main/src/components/IntegrationsContent.tsx

+ 8 - 0
shopcall.ai-main/src/components/IntegrationsContent.tsx

@@ -83,6 +83,13 @@ export function IntegrationsContent() {
       const data = await response.json();
       if (data.success) {
         const stores = data.stores || [];
+        // Debug: Log the sync config for each store
+        stores.forEach((store: ConnectedStore) => {
+          console.log(`[DEBUG] Store ${store.store_name}:`, {
+            enabled: store.store_sync_config?.[0]?.enabled,
+            sync_config: store.store_sync_config
+          });
+        });
         setConnectedShops(stores);
 
         // Update syncingStores - remove stores that finished syncing
@@ -323,6 +330,7 @@ export function IntegrationsContent() {
 
   const handleToggleStoreEnabled = async (storeId: string, storeName: string, currentEnabled: boolean) => {
     try {
+      console.log('[DEBUG] Toggle called:', { storeId, storeName, currentEnabled, newEnabled: !currentEnabled });
       const sessionData = localStorage.getItem('session_data');
       if (!sessionData) {
         throw new Error('No session data found');