Skip to content

Commit 530b364

Browse files
committed
wip push_device add thisDevice getter
1 parent 937456f commit 530b364

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/model/push_device.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,18 @@ class PushDeviceManager extends PerAccountStoreBase {
4646
///
4747
/// An absent map in [InitialSnapshot] (from an old server) is treated
4848
/// as empty, since a server without this feature has none of these records.
49+
///
50+
/// See also [thisDevice].
4951
// TODO(server-11) simplify doc re an absent map
5052
late Map<int, PushDeviceEntry> pushDevices = UnmodifiableMapView(_pushDevices);
5153
final Map<int, PushDeviceEntry> _pushDevices;
5254

55+
/// The push-device registration status the server currently reports for
56+
/// this very install of the app, if any.
57+
///
58+
/// This is an entry in [pushDevices].
59+
PushDeviceEntry? get thisDevice => _pushDevices[account.pushAccountId];
60+
5361
void handlePushDeviceEvent(PushDeviceEvent event) {
5462
final pushAccountId = int.tryParse(event.pushAccountId, radix: 10);
5563
if (pushAccountId == null) return; // TODO(log); TODO(#1764) push this to API parser

0 commit comments

Comments
 (0)