Fix URL prefix re-inserted when redirecting settings page #4650
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes issue reported on Discord where, when using a reverse proxy with a site prefix, that prefix would be re-inserted when redirecting from
/settings
to the default tab.This appears to have been introduced in #4378 where the
Settings
component was separated intoSettingTabs
andSettings
. Using the globallocation
variable within a component that isn't a page route appears to have broken the URL resolution in theRedirect
component. UsinguseLocation
instead appears to fix the issue. I moved the redirect logic intoSettings
as well, since it seemed a more appropriate place for it.