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

Frontend android back hashrouter #2705

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thisconnect
Copy link
Collaborator

No description provided.

benma and others added 2 commits May 8, 2024 07:26
Using the BrowserRouter is needlessly complicated, we don't need the
browser to make a new "request" when we route to a different
page. Getting this to work is especially difficult in iOS, where the
file path to index.html is loaded in the webview, and routing to
e.g. `/account-summary' fails because the absolute filepath
`/account-summary` does not exist and is outside the app folder
sandbox.

Using the hash router instead, where the app path is tracked behind
the `#` (e.g. index.html#/account-summary) is more appropriate and
easier to handle.
This should replace native Android back behavior with either going
back in the webview or closing the app.

This is using the native goBack method but it seems that the app
only goes back to account summary. This could probably be improved
later and seems already useful with just going back to summary.

On the account summary it cannot go back any further so it will
trigger the old do-you-want-to-quit alert.

Replaced deprecated onBackPressed override.
@thisconnect thisconnect force-pushed the frontend-android-back-hashrouter branch from 508f7dd to 7925b04 Compare May 8, 2024 05:27
@thisconnect
Copy link
Collaborator Author

rebased

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.

None yet

2 participants