fix heroku redirects

This commit is contained in:
Michael Schramm 2020-06-09 16:38:29 +02:00
parent acb26096d6
commit d40acbbc0b
3 changed files with 5 additions and 3 deletions

View File

@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- [OMF#93](https://github.com/ohmyform/ohmyform/issues/93) dropdown options are not saved
- redirect attempts on static export
## [0.9.2] - 2020-06-04

View File

@ -1,6 +1,5 @@
# OhMyForm UI
![Project Status](https://badgen.net/github/checks/ohmyform/ui)
[![Build Status](https://travis-ci.org/ohmyform/ui.svg?branch=master)](https://travis-ci.org/ohmyform/ui)
![Latest Release](https://badgen.net/github/tag/ohmyform/ui)
![Docker Pulls](https://badgen.net/docker/pulls/ohmyform/ui)

View File

@ -19,7 +19,7 @@ const Index: NextPage = () => {
const { t } = useTranslation()
useEffect(() => {
if (router.pathname !== window.location.pathname) {
if (router.pathname !== window.location.pathname && window.location.pathname.length > 2) {
let href = router.asPath
const as = router.asPath
const possible = [/(\/form\/)[^/]+/i, /(\/admin\/forms\/)[^/]+/i, /(\/admin\/users\/)[^/]+/i]
@ -38,7 +38,9 @@ const Index: NextPage = () => {
if (
publicRuntimeConfig.spa ||
(process.browser && router.pathname !== window.location.pathname)
(process.browser &&
router.pathname !== window.location.pathname &&
window.location.pathname.length > 2)
) {
return <LoadingPage message={t('loading')} />
}