Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notif: Preserve target account context on back navigation after opening a notification #1373

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lakshya1goel
Copy link
Contributor

Fixes: #1210

Description

When opening a notification from a different account B while in account A and pressing back, the app should stay in account B's context rather than returning to account A. This PR implements this behavior by:

  1. Checking if the current route belongs to a different account than the notification's target account
  2. If so, navigating to the target account's homepage before pushing the message list
  3. This ensures the navigation stack has the proper account context, making back navigation intuitive

Video Demonstration

WhatsApp.Video.2025-02-22.at.10.34.48.PM.mp4

@lakshya1goel lakshya1goel changed the title notif: Ensure back navigation preserves target account context after … notif: Ensure back navigation preserves target account context after opening notification Feb 22, 2025
@lakshya1goel lakshya1goel changed the title notif: Ensure back navigation preserves target account context after opening notification notif: Preserve target account context on back navigation after opening a notification Feb 22, 2025
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.

android: When opening a notification, "back" should not leave the account's context
1 participant