update method
Future<void>
update(
- String topic, {
- int? expiry,
- bool? active,
- 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;
}
// int prevExpiry = info.expiry;
// bool wasActive = info.active;
if (expiry != null) {
info.expiry = expiry;
}
if (active != null) {
info.active = active;
}
if (metadata != null) {
info.peerMetadata = metadata;
}
// onUpdate.broadcast(
// StoreUpdateEvent(
// topic,
// info,
// ),
// );
// print('Previous expiry: $prevExpiry, new expiry: ${info.expiry}');
// print('Previous active: $wasActive, new active: ${info.active}');
await set(topic, info);
// print('Saved PairingInfo');
// print(get(topic));
}