Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.wordpress.android.analytics.AnalyticsTracker;
import org.wordpress.android.analytics.AnalyticsTracker.Stat;
import org.wordpress.android.fluxc.Dispatcher;
import org.wordpress.android.fluxc.action.AccountAction;
import org.wordpress.android.fluxc.generated.AccountActionBuilder;
import org.wordpress.android.fluxc.generated.SiteActionBuilder;
import org.wordpress.android.fluxc.model.PostModel;
Expand Down Expand Up @@ -1466,7 +1467,12 @@ public void onAuthenticationChanged(OnAuthenticationChanged event) {
public void onAccountChanged(OnAccountChanged event) {
// Sign-out is handled in `handleSiteRemoved`, no need to show the signup flow here
if (mAccountStore.hasAccessToken()) {
if (mBottomNav != null) mBottomNav.showNoteBadge(mAccountStore.getAccount().getHasUnseenNotes());
if (mBottomNav != null) {
mBottomNav.showNoteBadge(mAccountStore.getAccount().getHasUnseenNotes());
if (event.causeOfChange == AccountAction.FETCH_ACCOUNT) {
mBottomNav.refreshGravatar();
}
}
Comment thread
adalpari marked this conversation as resolved.
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,13 @@ class WPMainNavigationView @JvmOverloads constructor(
showBadge(getPosition(NOTIFS), showBadge)
}

fun refreshGravatar() {
val imgIcon = getImageViewForPosition(getPosition(ME))
if (imgIcon != null) {
loadGravatar(imgIcon, accountStore.account?.avatarUrl.orEmpty())
}
}

/*
* show or hide the badge on the 'pageId' icon in the bottom bar
*/
Expand Down
Loading