Skip to content

Commit ebec526

Browse files
committed
store [nfc]: Reorder fields to put realm info together
Technically maxFileUploadSizeMib is for the whole server, I think, but it seems fine to treat it as realm info for the purpose of ordering these. See Greg's bulleted list here: zulip#183 (review)
1 parent 406b7d0 commit ebec526

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/model/store.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ class PerAccountStore extends ChangeNotifier {
149149
required this.connection,
150150
required InitialSnapshot initialSnapshot,
151151
}) : zulipVersion = initialSnapshot.zulipVersion,
152+
maxFileUploadSizeMib = initialSnapshot.maxFileUploadSizeMib,
152153
users = Map.fromEntries(
153154
initialSnapshot.realmUsers
154155
.followedBy(initialSnapshot.realmNonActiveUsers)
@@ -157,18 +158,17 @@ class PerAccountStore extends ChangeNotifier {
157158
streams = Map.fromEntries(initialSnapshot.streams.map(
158159
(stream) => MapEntry(stream.streamId, stream))),
159160
subscriptions = Map.fromEntries(initialSnapshot.subscriptions.map(
160-
(subscription) => MapEntry(subscription.streamId, subscription))),
161-
maxFileUploadSizeMib = initialSnapshot.maxFileUploadSizeMib;
161+
(subscription) => MapEntry(subscription.streamId, subscription)));
162162

163163
final Account account;
164164
final ApiConnection connection; // TODO(#135): update zulipFeatureLevel with events
165165

166166
// TODO(#135): Keep all this data updated by handling Zulip events from the server.
167167
final String zulipVersion; // TODO get from account; update there on initial snapshot
168+
final int maxFileUploadSizeMib; // No event for this.
168169
final Map<int, User> users;
169170
final Map<int, ZulipStream> streams;
170171
final Map<int, Subscription> subscriptions;
171-
final int maxFileUploadSizeMib; // No event for this.
172172

173173
// TODO lots more data. When adding, be sure to update handleEvent too.
174174

0 commit comments

Comments
 (0)