Skip to content

Commit 244da77

Browse files
committed
api: Add isActive to RealmUserUpdateEvent
This will become handy in the next commit(s) where we want to change the UI based on `User.isActive` when having a DM conversation.
1 parent c17dd0e commit 244da77

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

lib/api/model/events.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ class RealmUserUpdateEvent extends RealmUserEvent {
285285

286286
@JsonKey(readValue: _readFromPerson) final RealmUserUpdateCustomProfileField? customProfileField;
287287
@JsonKey(readValue: _readFromPerson) final String? newEmail;
288+
@JsonKey(readValue: _readFromPerson) final bool? isActive;
288289

289290
static Object? _readFromPerson(Map<dynamic, dynamic> json, String key) {
290291
return (json['person'] as Map<String, dynamic>)[key];
@@ -318,6 +319,7 @@ class RealmUserUpdateEvent extends RealmUserEvent {
318319
this.deliveryEmail,
319320
this.customProfileField,
320321
this.newEmail,
322+
this.isActive,
321323
});
322324

323325
factory RealmUserUpdateEvent.fromJson(Map<String, dynamic> json) =>

lib/api/model/events.g.dart

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/model/store.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
461461
if (event.isBillingAdmin != null) user.isBillingAdmin = event.isBillingAdmin!;
462462
if (event.deliveryEmail != null) user.deliveryEmail = event.deliveryEmail!.value;
463463
if (event.newEmail != null) user.email = event.newEmail!;
464+
if (event.isActive != null) user.isActive = event.isActive!;
464465
if (event.customProfileField != null) {
465466
final profileData = (user.profileData ??= {});
466467
final update = event.customProfileField!;

0 commit comments

Comments
 (0)