Show sync counts only when non-zero

Hide upload/download counts in the drawer footer when both are zero;
show each arrow count individually only if its value is greater than
zero. This avoids displaying redundant “↑0 ↓0” and ensures a
cleaner, more informative sync status line when only one direction has
activity.
This commit is contained in:
Tristan Michael 2026-04-05 16:38:21 -07:00
parent 0ae0705331
commit 44ac2bc5b3

View file

@ -335,7 +335,7 @@
class="inline-block h-2 w-2 rounded-full {app.syncing ? 'animate-pulse bg-primary' : app.syncStatus === 'synced' || app.syncStatus === 'idle' ? 'bg-green-500' : app.syncStatus === 'error' ? 'bg-red-500' : 'bg-gray-400'}" class="inline-block h-2 w-2 rounded-full {app.syncing ? 'animate-pulse bg-primary' : app.syncStatus === 'synced' || app.syncStatus === 'idle' ? 'bg-green-500' : app.syncStatus === 'error' ? 'bg-red-500' : 'bg-gray-400'}"
></span> ></span>
<span class="flex-1 text-xs opacity-60"> <span class="flex-1 text-xs opacity-60">
{app.syncing ? "Syncing..." : app.syncStatus === "synced" || app.syncStatus === "idle" ? "Synced" : app.syncStatus === "error" ? "Sync error" : "Offline"}{#if !app.syncing && app.lastSyncResult}&nbsp;&nbsp;{app.lastSyncResult.uploaded}{app.lastSyncResult.downloaded}{/if} {app.syncing ? "Syncing..." : app.syncStatus === "synced" || app.syncStatus === "idle" ? "Synced" : app.syncStatus === "error" ? "Sync error" : "Offline"}{#if !app.syncing && app.lastSyncResult && (app.lastSyncResult.uploaded > 0 || app.lastSyncResult.downloaded > 0)}&nbsp;&nbsp;{#if app.lastSyncResult.uploaded > 0}{app.lastSyncResult.uploaded}{/if}{#if app.lastSyncResult.uploaded > 0 && app.lastSyncResult.downloaded > 0} {/if}{#if app.lastSyncResult.downloaded > 0}{app.lastSyncResult.downloaded}{/if}{/if}
</span> </span>
<!-- Manual sync button --> <!-- Manual sync button -->
<button <button