diff --git a/src/webdrop_bridge/ui/main_window.py b/src/webdrop_bridge/ui/main_window.py index b4ac0b0..fbfc1b3 100644 --- a/src/webdrop_bridge/ui/main_window.py +++ b/src/webdrop_bridge/ui/main_window.py @@ -626,9 +626,9 @@ class MainWindow(QMainWindow): const data = await response.json(); console.log('[Checkout Check] Full data:', JSON.stringify(data)); console.log('[Checkout Check] Checkout field:', data.checkout); - const hasCheckout = data.checkout && Object.keys(data.checkout).length > 0; + const hasCheckout = !!(data.checkout && Object.keys(data.checkout).length > 0); console.log('[Checkout Check] Has checkout:', hasCheckout); - window['{callback_id}'] = JSON.stringify({{ checkout: data.checkout, hasCheckout: hasCheckout }}); + window['{callback_id}'] = JSON.stringify({{ checkout: data.checkout || null, hasCheckout: hasCheckout }}); }} else {{ console.log('[Checkout Check] Failed to fetch, status:', response.status); window['{callback_id}'] = JSON.stringify({{ error: 'Failed to fetch asset', status: response.status }});