Skip to content

Commit

Permalink
fix: app loading in non-standalone mode
Browse files Browse the repository at this point in the history
  • Loading branch information
zovomat committed May 19, 2022
1 parent b904928 commit a64a024
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
14 changes: 8 additions & 6 deletions src/boot/bootstrapper-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useBridge } from '../store/context-bridge';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import ShellView from '../shell/shell-view';
import { BASENAME } from '../constants';
import { BASENAME, IS_STANDALONE } from '../constants';
import { useAppStore } from '../store/app';

const ContextBridge: FC = () => {
Expand Down Expand Up @@ -41,11 +41,13 @@ const StandaloneListener: FC = () => {

const BootstrapperRouter: FC = () => (
<BrowserRouter basename={BASENAME}>
<Switch>
<Route path={'/:route'}>
<StandaloneListener />
</Route>
</Switch>
{IS_STANDALONE && (
<Switch>
<Route path={'/:route'}>
<StandaloneListener />
</Route>
</Switch>
)}
<ContextBridge />
<AppLoaderMounter />
<ShellView />
Expand Down
1 change: 0 additions & 1 deletion src/shell/shell-view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ function DarkReaderListener() {

const useLoginRedirection = (activeRoute) => {
const auth = useAccountStore((s) => s.authenticated);
console.log({ auth, activeRoute });
useEffect(() => {
if (IS_STANDALONE && !auth && activeRoute && !activeRoute.standalone?.allowUnauthenticated) {
goToLogin();
Expand Down
1 change: 0 additions & 1 deletion src/store/app/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import produce from 'immer';
import { filter, find, findIndex, merge, omit, reduce, sortBy, unionBy, unionWith } from 'lodash';
import create, { StoreApi, UseBoundStore } from 'zustand';
import { persist } from 'zustand/middleware';
import {
AppRouteDescriptor,
AppState,
Expand Down

0 comments on commit a64a024

Please sign in to comment.