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

Fix navbar back button behavior #195

Merged
merged 3 commits into from
Nov 21, 2022

Conversation

martinek
Copy link
Contributor

This PR fixes and issue with back button navigation from manga screen.

It changes the back button in DefaultNavBar to take into account location.state. This allows pages to specify behavior of back button on next page. Next page then can discern between navigating using history.goBack() or navigating to some default url instead of "hoping" that goBack() goes to correct screen.

In manga screen, this fixes issue where, coming from reader screen, and then clicking "back" button on manga screen would put user back to reader screen.

It also changes behavior of ReaderNavBar back button to simillary handle location.state

In reader screen, this fixes issue where if reader screen is open directly, the back button would not work.

Downside is that location state needs to be passed around in reader screen when changing chapters.

The backLink in location state can either be specific url or it can be set to __BACK__ to explicitly have the back button do history.goBack().

@AriaMoradi AriaMoradi merged commit 3972d77 into Suwayomi:master Nov 21, 2022
@martinek martinek deleted the fix/navbar-back-button branch November 21, 2022 16:18
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.

2 participants