diff --git a/src/initialize.js b/src/initialize.js index 5e3ad240f..a222d7061 100644 --- a/src/initialize.js +++ b/src/initialize.js @@ -89,6 +89,7 @@ import { APP_READY, APP_INIT_ERROR, } from './constants'; import configureCache from './auth/LocalForageCache'; +import { config } from 'localforage'; /** * A browser history or memory history object created by the [history](https://github.com/ReactTraining/history) @@ -105,22 +106,14 @@ export const history = (typeof window !== 'undefined') /** * The string basename that is the root directory of this MFE. * - * In devstack, this should always just return an empty string, because each MFE is in its own - * server/domain. + * In devstack, this should always just return "/", because each MFE is in its own server/domain. * * In Tutor, all MFEs are deployed to a common server, each under a different top-level directory. * The basename is the root path for a given MFE, e.g. "/library-authoring". It is set by tutor-mfe * as an ENV variable in the Docker file, and we read it here from that configuration so that it * can be passed into a Router later. - * - * By convention, our basenames do not have a trailing slash. So it's "/library-authoring", and not - * "/library-authoring/". Our configuration is inconsistent on this, so this function always strips - * off the trailing slash from any value entered in configuration. */ -export function basename() { - const configBasename = getPath(getConfig().PUBLIC_PATH); - return configBasename.endsWith('/') ? configBasename.slice(0, -1) : configBasename; -} +export const basename = getPath(getConfig().PUBLIC_PATH); /** * The default handler for the initialization lifecycle's `initError` phase. Logs the error to the diff --git a/src/react/AppProvider.jsx b/src/react/AppProvider.jsx index 6d430bf39..a2ccd8bb1 100644 --- a/src/react/AppProvider.jsx +++ b/src/react/AppProvider.jsx @@ -73,7 +73,7 @@ export default function AppProvider({ store, children, wrapWithRouter }) { > {wrapWithRouter ? ( - + {children} ) : children}