Skip to content

Fix Me tab Gravatar icon not updating on first launch#23103

Open
thirumani-vihaan wants to merge 3 commits into
wordpress-mobile:trunkfrom
thirumani-vihaan:fix/21415-first-run-gravatar
Open

Fix Me tab Gravatar icon not updating on first launch#23103
thirumani-vihaan wants to merge 3 commits into
wordpress-mobile:trunkfrom
thirumani-vihaan:fix/21415-first-run-gravatar

Conversation

@thirumani-vihaan

Copy link
Copy Markdown

Description

Fixes: #21415

On the very first launch (after a fresh app install and login), the Gravatar icon in the bottom navigation "Me" tab does not appear immediately. It requires a hard restart of the app to become visible.

This happens because the account record syncs asynchronously. By the time WPMainNavigationView is initialized, the avatarUrl might not be available yet. An onAccountChanged event fires in WPMainActivity once the user's account data successfully loads, but the bottom navigation view was never instructed to refresh its Gravatar icon dynamically.

Changes made:

  1. Added a refreshGravatar() method to WPMainNavigationView.kt that fetches the "Me" tab ImageView and safely updates it via loadGravatar() using the latest accountStore.account?.avatarUrl.
  2. Updated WPMainActivity.java inside onAccountChanged to invoke mBottomNav.refreshGravatar() when an updated account event is broadcasted.

Testing instructions

Fresh Install First-Run Avatar Load:

  1. Install a fresh build of the app (or clear all app data).
  2. Log into an account that has a Gravatar image set.
  • Verify that as soon as the login completes and you reach the main screen, the Gravatar image successfully appears on the "Me" tab (bottom right) without requiring an app restart.
  1. Log out and log back in with a different account.
  • Verify the new account's Gravatar immediately loads on the "Me" tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant