Skip to content

Commit 833069d

Browse files
committed
store [nfc]: Move account getter up to PerAccountStoreBase
1 parent 0aeeb35 commit 833069d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/model/store.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,13 @@ abstract class PerAccountStoreBase {
365365
// Data attached to the self-account on the realm.
366366

367367
int get accountId => _core.accountId;
368+
369+
/// The [Account] this store belongs to.
370+
///
371+
/// Will throw if the account has been removed from the global store,
372+
/// which is possible only if [PerAccountStore.dispose] has been called
373+
/// on this store.
374+
Account get account => _globalStore.getAccount(accountId)!;
368375
}
369376

370377
/// Store for the user's data for a given Zulip account.
@@ -581,12 +588,6 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
581588
////////////////////////////////
582589
// Data attached to the self-account on the realm.
583590

584-
/// The [Account] this store belongs to.
585-
///
586-
/// Will throw if the account has been removed from the global store,
587-
/// which is possible only if [dispose] has been called on this store.
588-
Account get account => _globalStore.getAccount(accountId)!;
589-
590591
final UserSettings? userSettings; // TODO(server-5)
591592

592593
final TypingNotifier typingNotifier;

0 commit comments

Comments
 (0)