From 714a6b758c11278802cef8cfb8e30ae3a1b26721 Mon Sep 17 00:00:00 2001 From: Edison Jwa Date: Sun, 31 May 2026 23:03:19 +0900 Subject: [PATCH] perf(ui): stop polling snapshots from audio stats --- apps/chanora_flutter/lib/main.dart | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/apps/chanora_flutter/lib/main.dart b/apps/chanora_flutter/lib/main.dart index 48e56fc..e0b71f0 100644 --- a/apps/chanora_flutter/lib/main.dart +++ b/apps/chanora_flutter/lib/main.dart @@ -311,7 +311,6 @@ class _BetaHomeState extends State<_BetaHome> with WidgetsBindingObserver { final List _uiDiagnostics = []; rust.BridgeAudioStats? _audioStats; Timer? _statsTimer; - int _statsTick = 0; bool _snapshotRefreshInFlight = false; bool _snapshotRefreshQueued = false; bool _snapshotRefreshQueuedRecordActivity = false; @@ -815,18 +814,10 @@ class _BetaHomeState extends State<_BetaHome> with WidgetsBindingObserver { final s = await rust.audioStats(); if (!mounted) return; setState(() => _audioStats = s); - _statsTick += 1; - if (_statsTick % 4 == 0) { - unawaited(_refreshSnapshotForVoiceStatus()); - } } catch (_) {} }); } - Future _refreshSnapshotForVoiceStatus() async { - await _refreshSnapshot(recordActivity: true, reportErrors: false); - } - @override void didChangeAppLifecycleState(AppLifecycleState state) { final stateName = state.name; @@ -1390,7 +1381,6 @@ class _BetaHomeState extends State<_BetaHome> with WidgetsBindingObserver { Future _finishDisconnect() async { _statsTimer?.cancel(); _statsTimer = null; - _statsTick = 0; _snapshotRefreshInFlight = false; _snapshotRefreshQueued = false; _snapshotRefreshQueuedRecordActivity = false;