mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 12:38:33 +00:00
Invalidate conversation list when it is not newly started.
This commit is contained in:
@@ -60,6 +60,7 @@ class ConversationListViewModel extends ViewModel {
|
|||||||
private String activeQuery;
|
private String activeQuery;
|
||||||
private SearchResult activeSearchResult;
|
private SearchResult activeSearchResult;
|
||||||
private int pinnedCount;
|
private int pinnedCount;
|
||||||
|
private boolean isNewlyCreated;
|
||||||
|
|
||||||
private ConversationListViewModel(@NonNull Application application, @NonNull SearchRepository searchRepository, boolean isArchived) {
|
private ConversationListViewModel(@NonNull Application application, @NonNull SearchRepository searchRepository, boolean isArchived) {
|
||||||
this.megaphone = new MutableLiveData<>();
|
this.megaphone = new MutableLiveData<>();
|
||||||
@@ -85,6 +86,7 @@ class ConversationListViewModel extends ViewModel {
|
|||||||
}
|
}
|
||||||
pagedData.getController().onDataInvalidated();
|
pagedData.getController().onDataInvalidated();
|
||||||
});
|
});
|
||||||
|
this.isNewlyCreated = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.hasNoConversations = LiveDataUtil.mapAsync(pagedData.getData(), conversations -> {
|
this.hasNoConversations = LiveDataUtil.mapAsync(pagedData.getData(), conversations -> {
|
||||||
@@ -141,6 +143,12 @@ class ConversationListViewModel extends ViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onStart() {
|
void onStart() {
|
||||||
|
if (!isNewlyCreated) {
|
||||||
|
pagedData.getController().onDataInvalidated();
|
||||||
|
}
|
||||||
|
|
||||||
|
isNewlyCreated = false;
|
||||||
|
|
||||||
ApplicationDependencies.getDatabaseObserver().registerConversationListObserver(observer);
|
ApplicationDependencies.getDatabaseObserver().registerConversationListObserver(observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user