File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
lib/core/viewmodels/main_page Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -137,9 +137,17 @@ class ChatInsideViewModel extends BaseViewModel {
137137 }
138138
139139 void fetchDialogFromRoot (int ? chatId) {
140- _dialog = _dialogsViewModel! .dialogs.cast <BaseDialogInfo >().firstWhere (
140+ final viewModel = _dialogsViewModel;
141+ final storedInfo = viewModel? .storedDialogInfo;
142+
143+ if (viewModel == null || storedInfo == null ) {
144+ _dialog = null ;
145+ return ;
146+ }
147+
148+ _dialog = viewModel.dialogs.cast <BaseDialogInfo >().firstWhere (
141149 (d) => d is Dialog && d.chatId == chatId,
142- orElse: () => _dialogsViewModel ! .storedDialogInfo ! ,
150+ orElse: () => storedInfo ,
143151 );
144152 }
145153
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ class FeedScreenViewModel extends BaseViewModel
9595 }
9696
9797 Future <void > loadMorePosts () async => await changeState (() async {
98- if (loadingMore) {
98+ if (loadingMore || _currentPage <= 0 ) {
9999 return ;
100100 }
101101 loadingMore = true ;
@@ -121,6 +121,12 @@ class FeedScreenViewModel extends BaseViewModel
121121 return ;
122122 }
123123 _addPostsToList (_totalPosts, freshPosts[BlogPostType .regular]);
124+ _addPostsToList (
125+ announcements,
126+ freshPosts[BlogPostType .important],
127+ isRegularPost: false ,
128+ );
129+
124130 failedToLoad = false ;
125131 _currentPage++ ;
126132 loadingMore = false ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: unn_mobile
22description : A mobile application for UNN Portal website
33publish_to : ' none'
44
5- version : 0.5.8+388
5+ version : 0.5.8+389
66
77environment :
88 sdk : ' >=3.1.2 <4.0.0'
You can’t perform that action at this time.
0 commit comments