perf(ui): stop polling snapshots from audio stats
This commit is contained in:
@@ -311,7 +311,6 @@ class _BetaHomeState extends State<_BetaHome> with WidgetsBindingObserver {
|
||||
final List<String> _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<void> _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<void> _finishDisconnect() async {
|
||||
_statsTimer?.cancel();
|
||||
_statsTimer = null;
|
||||
_statsTick = 0;
|
||||
_snapshotRefreshInFlight = false;
|
||||
_snapshotRefreshQueued = false;
|
||||
_snapshotRefreshQueuedRecordActivity = false;
|
||||
|
||||
Reference in New Issue
Block a user