diff --git a/js/geolocation.js b/js/geolocation.js index 5413de1..ef5366b 100644 --- a/js/geolocation.js +++ b/js/geolocation.js @@ -80,7 +80,7 @@ function showManualLocationInput(callback) { const parsedLat = parseFloat(lat); const parsedLon = parseFloat(lon); - if (isNaN(parsedLat) || isNaN(parsedLon)) { + if (Number.isNaN(parsedLat) || Number.isNaN(parsedLon)) { alert("❌ Invalid coordinates. Please enter valid numbers."); showManualLocationInput(callback); return; diff --git a/js/invoice.js b/js/invoice.js index 162fdc1..f14bed8 100644 --- a/js/invoice.js +++ b/js/invoice.js @@ -24,7 +24,7 @@ window.invoiceGenerator = (() => { // Retrieve order details from localStorage function getOrderById(orderId) { try { - const orders = JSON.parse(localStorage.getItem('chaatOrders')) || []; + const orders = (JSON.parse(localStorage.getItem('chaatOrders') ?? "null") ?? null) || []; return orders.find(o => o.id === orderId); } catch (error) { console.error("Error loading order for invoice:", error); @@ -268,7 +268,7 @@ window.invoiceGenerator = (() => { `; }); - printContainer.innerHTML = ` + printContainer.textContent = `