Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

Messages: replace instead of push state to match web#1675

Open
jas14 wants to merge 1 commit intolichess-org:masterfrom
jas14:chat-history
Open

Messages: replace instead of push state to match web#1675
jas14 wants to merge 1 commit intolichess-org:masterfrom
jas14:chat-history

Conversation

@jas14
Copy link
Copy Markdown
Collaborator

@jas14 jas14 commented May 8, 2021

May fix #1659. The mobile app used History.pushState where the website used History.replaceState, which made it difficult to navigate out of chat using the native back button after opening conversations many times.

After this PR, the messages behavior will be as follows:

  • When opening a conversation, the current history entry, /inbox, will be replaced with the conversation path (/inbox/<userId>).
  • When navigating back to the inbox via the back arrow, the history entry will not be replaced (that is, the URL will reflect the specific conversation that was just closed).

This means that at any point in the messages UI, hitting the native "back" button will exit the messages UI entirely. I don't love this behavior, but 1) it matches the website and 2) I see no way to avoid it without relying on history.back(), which would cause an unnecessary XHR reload of the inbox.

Tested locally using Chrome.

@veloce
Copy link
Copy Markdown
Collaborator

veloce commented May 11, 2021

Thanks! I need to test this in order to understand exactly what's going on here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buggy inbox in lichess Mobile App

2 participants