From 69411d0c54a8ac6cfce5c99ca01ad453c838f0c2 Mon Sep 17 00:00:00 2001 From: Gold872 Date: Sat, 16 Dec 2023 19:37:24 -0500 Subject: [PATCH] Don't request new subscription stream value for graph widgets --- lib/services/nt4_client.dart | 12 +----------- lib/widgets/nt_widgets/nt_widget.dart | 4 +++- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/services/nt4_client.dart b/lib/services/nt4_client.dart index 0bc06d54..c13ff2c1 100644 --- a/lib/services/nt4_client.dart +++ b/lib/services/nt4_client.dart @@ -399,17 +399,7 @@ class NT4Client { } NT4Topic? getTopicFromName(String topic) { - for (NT4Topic t in announcedTopics.values) { - if (t.name == topic) { - return t; - } - } - if (announcedTopics.values - .firstWhereOrNull((e) => e.name.startsWith('/$topic')) != - null) { - logger.debug('[NT4] Topic not found: $topic'); - } - return null; + return announcedTopics.values.firstWhereOrNull((e) => e.name == topic); } bool isTopicPublished(NT4Topic? topic) { diff --git a/lib/widgets/nt_widgets/nt_widget.dart b/lib/widgets/nt_widgets/nt_widget.dart index 8633ebc1..1854f402 100644 --- a/lib/widgets/nt_widgets/nt_widget.dart +++ b/lib/widgets/nt_widgets/nt_widget.dart @@ -162,7 +162,9 @@ abstract class NTWidget extends StatelessWidget { void refresh() { Future(() async { notifier?.refresh(); - subscription?.requestNewValue(); + if (type != 'Graph') { + subscription?.requestNewValue(); + } }); }