closeSubscription method

  1. @override
Future<void> closeSubscription(
  1. String id
)
override

close a relay subscription, the relay connection will be kept open and closed automatically (garbage collected)

Implementation

@override
closeSubscription(String id) async {
  //await seedRelaysConnected;
  for (var relay in globalState.connectedRelays) {
    if (relay.activeSubscriptions.containsKey(id)) {
      await relay.closeSubscription(id);
      relay.activeSubscriptions.remove(id);
    }
  }
}