Skip to content

Commit 75ae045

Browse files
committed
msglist [nfc]: Remove one nested try block in _fetchMore
The nested `try` block doesn't seem to be making any difference, so good to remove.
1 parent fa06bea commit 75ae045

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

lib/model/message_list.dart

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -937,23 +937,20 @@ class MessageListView with ChangeNotifier, _MessageSequence {
937937
final generation = this.generation;
938938
bool hasFetchError = false;
939939
try {
940-
final GetMessagesResult result;
941-
try {
942-
result = await getMessages(store.connection,
943-
narrow: narrow.apiEncode(),
944-
anchor: anchor,
945-
includeAnchor: false,
946-
numBefore: numBefore,
947-
numAfter: numAfter,
948-
allowEmptyTopicName: true,
949-
);
950-
} catch (e) {
951-
hasFetchError = true;
952-
rethrow;
953-
}
940+
final result = await getMessages(store.connection,
941+
narrow: narrow.apiEncode(),
942+
anchor: anchor,
943+
includeAnchor: false,
944+
numBefore: numBefore,
945+
numAfter: numAfter,
946+
allowEmptyTopicName: true,
947+
);
954948
if (this.generation > generation) return;
955949

956950
processResult(result);
951+
} catch (e) {
952+
hasFetchError = true;
953+
rethrow;
957954
} finally {
958955
if (this.generation == generation) {
959956
if (hasFetchError) {

0 commit comments

Comments
 (0)