diff --git a/packages/client/package.json b/packages/client/package.json index 685f500f59..2670d029c5 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -3,7 +3,7 @@ "version": "0.3.8", "license": "MPL-2.0", "main": "dist/budibase-client.js", - "module": "dist/budibase-client.esm.mjs", + "module": "dist/budibase-client.js", "scripts": { "build": "rollup -c", "dev:builder": "rollup -cw" diff --git a/packages/client/src/store/routes.js b/packages/client/src/store/routes.js index 4443844b39..c69bb83ef0 100644 --- a/packages/client/src/store/routes.js +++ b/packages/client/src/store/routes.js @@ -34,7 +34,7 @@ const createRouteStore = () => { } const setActiveRoute = route => { store.update(state => { - state.activeRoute = route + state.activeRoute = state.routes.find(x => x.path === route) return state }) } diff --git a/packages/client/src/store/screens.js b/packages/client/src/store/screens.js index 31923f198d..54c7dda109 100644 --- a/packages/client/src/store/screens.js +++ b/packages/client/src/store/screens.js @@ -24,9 +24,9 @@ const createScreenStore = () => { activeLayout = layouts[0] if (screens.length === 1) { activeScreen = screens[0] - } else { + } else if ($routeStore.activeRoute) { activeScreen = screens.find( - screen => screen.routing.route === $routeStore.activeRoute + screen => screen._id === $routeStore.activeRoute.screenId ) } if (activeScreen) {