Skip to content

Commit b5b48cd

Browse files
author
Saurabh Kumar Bajpai
committed
fix: code quality and safety improvements
1 parent 72a15c4 commit b5b48cd

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

frontend/src/components/Ai.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ const USER_QUICK_REPLIES = [
9898
// headers: { 'Content-Type': 'application/json' },
9999
// body: JSON.stringify({ message }),
100100
// });
101-
// const data = await res.json();
101+
// if (!res.ok) throw new Error("Request failed");
102+
const data = await res.json();
102103
// setIsTyping(false);
103104
// speak(data.reply || "Sorry, I couldn't get a response.");
104105
// } catch (err) {

frontend/src/pages/Collections.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const FilterContent = ({
8080
max={maxPrice}
8181
value={priceRange[1]}
8282
onChange={(e) =>
83-
setPriceRange([priceRange[0], parseInt(e.target.value)])
83+
setPriceRange([priceRange[0], parseInt(e.target.value, 10)])
8484
}
8585
className="w-full h-2 bg-slate-300 dark:bg-gray-700 rounded-lg appearance-none cursor-pointer slider-thumb"
8686
aria-valuemin={minPrice}

frontend/utils/Firebase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if (missingFirebaseEnv.length > 0) {
2323

2424
// React hasn't mounted yet at this point, so we write directly to the DOM
2525
// to avoid leaving the user with a silent blank white screen.
26-
document.body.innerHTML = `
26+
document.body.textContent = `
2727
<div style="font-family: sans-serif; max-width: 480px; margin: 80px auto; padding: 24px; text-align: center; color: #333;">
2828
<h2 style="color:#c0392b;">We're currently unavailable</h2>
2929
<p>This application is temporarily unavailable due to a configuration issue. Please try again later or contact support.</p>

0 commit comments

Comments
 (0)