retrieve user profile only during onboarding

This commit is contained in:
Ryan ZHAO
2024-05-30 16:08:05 +10:00
parent 4acc42730b
commit a37039cebf
3 changed files with 84 additions and 6 deletions

View File

@@ -454,6 +454,13 @@ public class ApplicationContext extends Application implements DefaultLifecycleO
ClosedGroupPollerV2.getShared().start();
}
public void retrieveUserProfile() {
setUpPollingIfNeeded();
if (poller != null) {
poller.retrieveUserProfile();
}
}
private void resubmitProfilePictureIfNeeded() {
// Files expire on the file server after a while, so we simply re-upload the user's profile picture
// at a certain interval to ensure it's always available.

View File

@@ -82,7 +82,7 @@ class LoadingViewModel @Inject constructor(
}
// start polling and wait for updated message
ApplicationContext.getInstance(context).apply { startPollingIfNeeded() }
ApplicationContext.getInstance(context).apply { retrieveUserProfile() }
TextSecurePreferences.events.filter { it == TextSecurePreferences.CONFIGURATION_SYNCED }.collect {
// handle we've synced
skipJob.cancel()