fix: purge stale 1-tap mobile pins, make remove pin button bold and prominent, and bust service worker cache

This commit is contained in:
2026-09-12 09:18:33 -07:00
parent 872be94476
commit 2bd6ebe302
4 changed files with 69 additions and 25 deletions
+10 -5
View File
@@ -301,8 +301,12 @@
window.FlockAuth.clearUnverifiedReports();
}
// Filter out any unverified user pins
allCameras = [...DEFAULT_CAMERAS].filter(c => !c.id.startsWith('usr-pin-'));
// Filter out any unverified user pins or accidental test marks
allCameras = [...DEFAULT_CAMERAS].filter(c =>
!c.id.startsWith('usr-pin-') &&
c.notes !== '1-Tap Mobile Driver Pin' &&
c.name !== 'Community Report: Fixed ALPR Camera'
);
// Load crowdsourced reports from auth store (ONLY if photo verified!)
if (window.FlockAuth) {
@@ -418,9 +422,10 @@
Inspect Agency Records & Sharing ↗
</button>
` : ''}
${(cam.isCommunity || cam.id.startsWith('rpt-') || cam.id.startsWith('usr-pin-') || cam.id.startsWith('test-') || cam.id.startsWith('cam-test-')) ? `
<button class="popup-inspect-btn" style="background: rgba(239, 68, 68, 0.18); border: 1px solid #ef4444; color: #f87171;" onclick="window.adminDeleteCamera('${escapeHtml(cam.id)}')">
🗑️ Admin: Delete Placed Pin
${(!cam.id.startsWith('portal-') && (cam.isCommunity || cam.id.startsWith('rpt-') || cam.id.startsWith('usr-pin-') || cam.id.startsWith('test-') || cam.id.startsWith('cam-test-') || cam.notes === '1-Tap Mobile Driver Pin' || cam.agency === 'Crowdsourced Report' || cam.name.includes('Community Report'))) ? `
<button class="popup-inspect-btn popup-delete-btn" style="background: #dc2626 !important; color: #ffffff !important; font-weight: 800 !important; font-size: 0.88rem !important; padding: 10px 14px !important; border-radius: 6px !important; margin-top: 6px !important; display: flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important; border: none !important; cursor: pointer !important; box-shadow: 0 3px 10px rgba(220, 38, 38, 0.45) !important;" onclick="window.adminDeleteCamera('${escapeHtml(cam.id)}')">
<span style="font-size: 1rem;">🗑️</span>
<span>REMOVE THIS PIN (ADMIN)</span>
</button>
` : ''}
</div>