fix the profile picture not updated right away

This commit is contained in:
Ryan ZHAO 2021-02-25 10:18:38 +11:00
parent 6f76f0046a
commit 7a31c60799
2 changed files with 2 additions and 0 deletions

View File

@ -154,6 +154,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity, ConversationClickListe
override fun onResume() {
super.onResume()
if (TextSecurePreferences.getLocalNumber(this) == null) { return; } // This can be the case after a secondary device is auto-cleared
profileButton.recycle() // clear cached image before update tje profilePictureView
profileButton.update()
val hasViewedSeed = TextSecurePreferences.getHasViewedSeed(this)
if (hasViewedSeed) {

View File

@ -218,6 +218,7 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
TextSecurePreferences.setProfileAvatarId(this, SecureRandom().nextInt())
ProfileKeyUtil.setEncodedProfileKey(this, encodedProfileKey)
ApplicationContext.getInstance(this).updateOpenGroupProfilePicturesIfNeeded()
profilePictureView.recycle() // clear cached image before update tje profilePictureView
profilePictureView.update()
}
profilePictureToBeUploaded = null