perf: watch together CPU overhead

This commit is contained in:
edde746
2026-03-08 16:57:15 +01:00
parent 9e2e1f72ce
commit 16676bca49
5 changed files with 44 additions and 63 deletions
@@ -440,8 +440,11 @@ class WatchTogetherProvider with ChangeNotifier {
if (message.peerId != null) {
final index = _participants.indexWhere((p) => p.peerId == message.peerId);
if (index >= 0) {
_participants[index] = _participants[index].copyWith(isBuffering: message.bufferingState ?? false);
notifyListeners();
final newState = message.bufferingState ?? false;
if (_participants[index].isBuffering != newState) {
_participants[index] = _participants[index].copyWith(isBuffering: newState);
notifyListeners();
}
}
}
break;