fix: Sync-Indikator Listener-Cleanup und CSS-Zustände

useSyncIndicator gibt die Unsubscribe-Funktion von subscribeToSyncState
zurück. conn-status-Klassen berücksichtigen jetzt auch den aktiven
Sync-Lauf (syncing) statt nur die Queue-Länge.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-31 12:26:33 +02:00
parent d9cbcd8e43
commit 814eeadd1f
4 changed files with 39 additions and 8 deletions
+7 -2
View File
@@ -129,7 +129,12 @@ export default function UserProfilePage({ onBack, onLogout }: UserProfilePagePro
const [pendingRecoveryPhrase, setPendingRecoveryPhrase] = useState<string | null>(null)
const [recoveryCopied, setRecoveryCopied] = useState(false)
const { pendingCount: pendingSyncCount, showSpinner, showPendingWarning } = useSyncIndicator()
const {
pendingCount: pendingSyncCount,
showSpinner,
showPendingWarning,
connStatusClassName
} = useSyncIndicator()
const sharedLogbookCount = useLiveQuery(
() => db.logbooks.filter((lb) => lb.isShared === 1).count(),
@@ -528,7 +533,7 @@ export default function UserProfilePage({ onBack, onLogout }: UserProfilePagePro
<h3>{t('profile.device_title')}</h3>
</div>
<p className="profile-section-desc">{t('profile.device_desc')}</p>
<div className={`profile-device-status conn-status ${online ? (pendingSyncCount > 0 ? 'warning' : 'online') : 'offline'}`}>
<div className={`profile-device-status ${connStatusClassName(online)}`}>
{online ? (
showSpinner ? (
<>