update method

  1. @override
Future<void> update(
  1. String topic, {
  2. int? expiry,
  3. bool? active,
  4. PairingMetadata? metadata,
})
override

Implementation

@override
Future<void> update(
  String topic, {
  int? expiry,
  bool? active,
  PairingMetadata? metadata,
}) async {
  checkInitialized();

  PairingInfo? info = get(topic);
  if (info == null) {
    return;
  }

  if (expiry != null) {
    info = info.copyWith(expiry: expiry);
  }
  if (active != null) {
    info = info.copyWith(active: active);
  }
  if (metadata != null) {
    info = info.copyWith(peerMetadata: metadata);
  }

  await set(topic, info);
}