diff --git a/static/index.html b/static/index.html
index ddaea4a..eb7ddf7 100644
--- a/static/index.html
+++ b/static/index.html
@@ -3707,12 +3707,9 @@
}
function connectFromGallery() {
- const pp = document.getElementById('photoPicker');
- if (pp) {
- // Override the default handler for connect mode
- pp._connectMode = true;
- pp.click();
- }
+ window._connectMode = true;
+ const gi = document.getElementById('galleryInput');
+ if (gi) gi.click();
}
async function captureConnectPhoto() {
@@ -4031,20 +4028,24 @@
document.getElementById('connectLabelList').innerHTML = '';
}
- // ── Hook into gallery picker for connect mode ────────────────────────────
+ // ── Hook into gallery/camera pickers for connect mode ─────────────────
(function() {
- const pp = document.getElementById('photoPicker');
- const origHandler = pp.onchange;
- pp.addEventListener('change', function(e) {
- if (pp._connectMode) {
- pp._connectMode = false;
- if (e.target.files && e.target.files[0]) {
- processConnectLabelPhoto(e.target.files[0]);
+ function hookPicker(elId) {
+ const el = document.getElementById(elId);
+ if (!el) return;
+ el.addEventListener('change', function(e) {
+ if (window._connectMode) {
+ window._connectMode = false;
+ if (e.target.files && e.target.files[0]) {
+ processConnectLabelPhoto(e.target.files[0]);
+ }
+ el.value = ''; // Reset so same file can be picked again
+ return;
}
- pp.value = ''; // Reset so same file can be picked again
- return;
- }
- });
+ });
+ }
+ hookPicker('cameraInput');
+ hookPicker('galleryInput');
})();
// ═══════════════════════════════════════════════════════════════════════
@@ -7316,7 +7317,6 @@
req.onerror = (e) => { reject(e.target.error); };
});
}
-
async function queueOfflineCreate(assetPayload, photoBlob) {
await openOfflineDB();
const entry = {
@@ -7578,6 +7578,8 @@
return { id: null, _queued: true, machine_id: payload.machine_id, name: payload.name };
}
+
+
async function initOfflineSupport() {
await registerServiceWorker();
await openOfflineDB();
@@ -7587,6 +7589,7 @@
if (!navigator.onLine) { showOfflineBanner(); }
}
+ window.__scriptLineReached = 7593;
// ═══════════════════════════════════════════════════════════════════════
// T3: Hook EXIF GPS extraction into camera capture
// ═══════════════════════════════════════════════════════════════════════
@@ -7635,7 +7638,7 @@
// ═══════════════════════════════════════════════════════════════════════
// INIT — only lightweight auth & offline. Camera/GPS/assets start after login.
// ═══════════════════════════════════════════════════════════════════════
- initOfflineSupport();
+ initOfflineSupport().catch(e => console.warn('[Offline] init failed:', e));
initAuth();