Front End Code for the MassEnergize Community Portal. The community portal is customized for each participating community, and has the canonical URL https://community.massenergize.org/<community-name>/. For example, https://community.massenergize.org/wayland/.
MIT License
5
stars
2
forks
source link
On Safari, Custom Url is replaced by the generic community.massenergize.org/subdomain #1336
When you visit a site with custom domain on Safari, the URL changes to the generic URL. This is causing an infinite loop in safari for sites with custom URLs, so has been promoted to CRITICAL bug
The following code in AppRouter causes the problem, and I don't remember why it is there. @frimpongopoku
if (browswerIsSafari() && siteUsesCustomDomain()) { const subd = pathname.toLowerCase().indexOf(subdomain.toLowerCase()) > -1 ? "" : "/" + subdomain; window.location.href = MASSENERGIZE_PRODUCTION_URL + subd + pathname; }
To Reproduce
Steps to reproduce the behavior:
Open Safari browser on laptop or mobile device
Go to EnergizeWayland.org
See error in the URL browser bar
Expected behavior
The URL should show the custom URL.
Screenshots or video
If applicable, add screenshots or video to help explain your problem.
Desktop (please complete the following information):
OS: MacOS
Browser: Safari (potentially others, not Chrome)
Version any
Smartphone (please complete the following information):
Device: IPhone
OS: IOS
Browser Safari (potentially others)
Version any
Additional context
Bug reported by Mike Roy from Energy Navigators - he wants this fixed soon.
Describe the bug
When you visit a site with custom domain on Safari, the URL changes to the generic URL.
This is causing an infinite loop in safari for sites with custom URLs, so has been promoted to CRITICAL bug
The following code in AppRouter causes the problem, and I don't remember why it is there. @frimpongopoku
if (browswerIsSafari() && siteUsesCustomDomain()) { const subd = pathname.toLowerCase().indexOf(subdomain.toLowerCase()) > -1 ? "" : "/" + subdomain; window.location.href = MASSENERGIZE_PRODUCTION_URL + subd + pathname; }
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The URL should show the custom URL.
Screenshots or video
If applicable, add screenshots or video to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Bug reported by Mike Roy from Energy Navigators - he wants this fixed soon.