Skip to content

Commit

Permalink
Don't request new subscription stream value for graph widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Dec 17, 2023
1 parent 0da3959 commit 69411d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 1 addition & 11 deletions lib/services/nt4_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion lib/widgets/nt_widgets/nt_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ abstract class NTWidget extends StatelessWidget {
void refresh() {
Future(() async {
notifier?.refresh();
subscription?.requestNewValue();
if (type != 'Graph') {
subscription?.requestNewValue();
}
});
}

Expand Down

0 comments on commit 69411d0

Please sign in to comment.