From 6afbfd793a0ba363393870933c19b78a00609774 Mon Sep 17 00:00:00 2001 From: default Date: Sun, 25 Jan 2026 17:40:26 +0000 Subject: [PATCH] More Bug Fixes --- .../src/lib/components/CameraScreen.svelte | 38 --------------- .../src/lib/components/MobileHomePage.svelte | 47 +------------------ 2 files changed, 2 insertions(+), 83 deletions(-) diff --git a/frontend/src/lib/components/CameraScreen.svelte b/frontend/src/lib/components/CameraScreen.svelte index d5d8228..743766a 100644 --- a/frontend/src/lib/components/CameraScreen.svelte +++ b/frontend/src/lib/components/CameraScreen.svelte @@ -119,17 +119,6 @@ } } - function processResult(data: any, imageUri: string) { - analyzing = false; - if (!data) { - displayTitle = "Scan Failed"; - alternatives = []; - showResult = true; - resultTranslateY = 0; - typeText(); - }, 1200); - } - function processResult(data: any, imageUri: string) { analyzing = false; if (!data) { @@ -534,33 +523,6 @@ margin: 4px 0; } - .alt-price { - color: #9ca3af; - margin: 0; - font-size: 13px; - } - - .report-btn { - display: flex; - align-items: center; - justify-content: center; - gap: 8px; - margin: 32px auto 0; - padding: 14px 24px; - background: rgba(239, 68, 68, 0.1); - border: 1px solid rgba(239, 68, 68, 0.2); - border-radius: 16px; - cursor: pointer; - color: #f87171; - font-weight: 700; - font-size: 15px; - width: 100%; - } - - .report-btn:active { - background: rgba(239, 68, 68, 0.2); - } - .upload-placeholder { display: flex; flex-direction: column; diff --git a/frontend/src/lib/components/MobileHomePage.svelte b/frontend/src/lib/components/MobileHomePage.svelte index 3adb751..91d318d 100644 --- a/frontend/src/lib/components/MobileHomePage.svelte +++ b/frontend/src/lib/components/MobileHomePage.svelte @@ -2,49 +2,6 @@ import { onMount } from "svelte"; import Icon from "@iconify/svelte"; - const scanHistory = [ - { - id: 1, - name: "Plastic Water Bottle", - date: "Today, 10:45 AM", - severity: "High", - image: "/water-bottle.png", - impact: "Negative Impact", - }, - { - id: 2, - name: "Organic Banana", - date: "Yesterday, 3:20 PM", - severity: "Low", - image: "/banana.png", - impact: "Positive Choice", - }, - { - id: 3, - name: "Aluminum Soda Can", - date: "Mon, 12:15 PM", - severity: "Low", - image: "/soda-can.png", - impact: "Recyclable", - }, - { - id: 4, - name: "Takeout Container", - date: "Sun, 8:30 PM", - severity: "Medium", - image: "/container.png", - impact: "Mixed Materials", - }, - { - id: 5, - name: "Shampoo Bottle", - date: "Sat, 11:00 AM", - severity: "High", - image: "/shampoo.png", - impact: "High Plastic", - }, - ]; - interface ScanItem { id: string; name: string; @@ -60,7 +17,7 @@ let scanHistory = $state([]); let selectedScan = $state(null); let userId = $state(""); - let fileInput: HTMLInputElement; + let fileInput: HTMLInputElement | undefined; let isScanning = $state(false); onMount(() => { @@ -112,7 +69,7 @@ } function triggerScan() { - if (isScanning) return; + if (isScanning || !fileInput) return; fileInput.click(); }