OverviewFilesCommitsIssuesDocsReleasesPeers

wirecore commits / 29bdf90

Fix bridge status ReferenceError: pending is not defined
The variable 'pending' was declared inside an if block but used outside its scope in the stats update section. Moved all stat variables (pending, pushed, pulled) to function scope with safe extraction using logical OR operators. This fixes the "error loading data" in bridge status display. Released as v4198 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
29bdf90b175b427f52e5b9223281e2862e49d0a4
by plankatron <fleeky@gmail.com> · 2026-01-22T16:33:11.000Z

Changed files (1) +5 -3

pear-app/public/app-simple.js +5 -3
……@@ -839,18 +839,20 @@ async function showSettingsModal() {
839839 const relayOnline = status.status && status.status.relay && status.status.relay.online
840840 const bridgeRunning = status.running
841841
842 // Extract stats for display (declare at function scope)
843 const pending = (status.status && status.status.sync && status.status.sync.pendingPosts) || 0
844 const pushed = (status.status && status.status.stats && status.status.stats.totalPushed) || 0
845 const pulled = (status.status && status.status.stats && status.status.stats.totalPulled) || 0
846
842847 let statusHtml = '<div class="status-info">'
843848 statusHtml += `<div class="status-item"><strong>Bridge:</strong> ${bridgeRunning ? '🟢 Running' : '🔴 Stopped'}</div>`
844849 statusHtml += `<div class="status-item"><strong>Relay:</strong> ${relayOnline ? '🟢 Online' : '🔴 Offline'}</div>`
845850
846851 if (status.status && status.status.sync) {
847 const pending = status.status.sync.pendingPosts || 0
848852 statusHtml += `<div class="status-item"><strong>Pending:</strong> ${pending} posts</div>`
849853 }
850854
851855 if (status.status && status.status.stats) {
852 const pushed = status.status.stats.totalPushed || 0
853 const pulled = status.status.stats.totalPulled || 0
854856 statusHtml += `<div class="status-item"><strong>Synced:</strong> ${pushed} pushed, ${pulled} pulled</div>`
855857
856858 // Update stats display