diff --git a/src/middlewares/setLocationPath.ts b/src/middlewares/setLocationPath.ts index 3210796c..475cb205 100644 --- a/src/middlewares/setLocationPath.ts +++ b/src/middlewares/setLocationPath.ts @@ -1,15 +1,14 @@ import { QContext } from "../../index"; import { getCurrentEnvURL } from "../utils"; -export default function setLocationPath(context: QContext, done: () => void): void { - - const { currentLocationPath, instance } = context; - - if (typeof currentLocationPath === "undefined") { - context.currentLocationPath = context.to = getCurrentURLPath(instance.root); +export default function setLocationPath(context: QContext, done) { + if (typeof context.currentLocationPath === "undefined") { + context.currentLocationPath = context.to = getCurrentEnvURL( + context.instance.root + ); } - - context.currentLocationPath = instance._checkForAHash(currentLocationPath); - + context.currentLocationPath = context.instance._checkForAHash( + context.currentLocationPath + ); done(); }