Skip to content

Commit 678f1cd

Browse files
committed
store [nfc]: Move realmUrl up to PerAccountStoreBase
1 parent a64948f commit 678f1cd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/model/store.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,12 @@ abstract class PerAccountStoreBase {
362362

363363
ApiConnection get connection => _core.connection;
364364

365+
////////////////////////////////
366+
// Data attached to the realm or the server.
367+
368+
/// Always equal to `account.realmUrl` and `connection.realmUrl`.
369+
Uri get realmUrl => connection.realmUrl;
370+
365371
////////////////////////////////
366372
// Data attached to the self-account on the realm.
367373

@@ -425,7 +431,6 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
425431
return PerAccountStore._(
426432
core: core,
427433
queueId: queueId,
428-
realmUrl: realmUrl,
429434
realmWildcardMentionPolicy: initialSnapshot.realmWildcardMentionPolicy,
430435
realmMandatoryTopics: initialSnapshot.realmMandatoryTopics,
431436
realmWaitingPeriodThreshold: initialSnapshot.realmWaitingPeriodThreshold,
@@ -467,7 +472,6 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
467472
PerAccountStore._({
468473
required super.core,
469474
required this.queueId,
470-
required this.realmUrl,
471475
required this.realmWildcardMentionPolicy,
472476
required this.realmMandatoryTopics,
473477
required this.realmWaitingPeriodThreshold,
@@ -486,8 +490,7 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
486490
required this.unreads,
487491
required this.recentDmConversationsView,
488492
required this.recentSenders,
489-
}) : assert(realmUrl == core.connection.realmUrl),
490-
assert(emoji.realmUrl == realmUrl),
493+
}) : assert(emoji.realmUrl == core.connection.realmUrl),
491494
_realmEmptyTopicDisplayName = realmEmptyTopicDisplayName,
492495
_emoji = emoji,
493496
_users = users,
@@ -521,9 +524,6 @@ class PerAccountStore extends PerAccountStoreBase with ChangeNotifier, EmojiStor
521524
////////////////////////////////
522525
// Data attached to the realm or the server.
523526

524-
/// Always equal to `account.realmUrl` and `connection.realmUrl`.
525-
final Uri realmUrl;
526-
527527
/// Resolve [reference] as a URL relative to [realmUrl].
528528
///
529529
/// This returns null if [reference] fails to parse as a URL.

0 commit comments

Comments
 (0)