fix: reload the page when login token expired (#1839)

This commit is contained in:
Himself65
2023-04-06 18:26:53 -05:00
committed by GitHub
parent 5ac36b6f0a
commit efe5444816
10 changed files with 80 additions and 16 deletions

View File

@@ -25,7 +25,6 @@ import {
import { HelpIsland } from '../components/pure/help-island';
import { PageLoading } from '../components/pure/loading';
import WorkSpaceSliderBar from '../components/pure/workspace-slider-bar';
import { useAffineRefreshAuthToken } from '../hooks/affine/use-affine-refresh-auth-token';
import {
useSidebarFloating,
useSidebarResizing,
@@ -187,11 +186,6 @@ export const WorkspaceLayout: FC<PropsWithChildren> =
);
};
function AffineWorkspaceEffect() {
useAffineRefreshAuthToken();
return null;
}
export const WorkspaceLayoutInner: FC<PropsWithChildren> = ({ children }) => {
const [currentWorkspace] = useCurrentWorkspace();
const [currentPageId] = useCurrentPageId();
@@ -348,7 +342,6 @@ export const WorkspaceLayoutInner: FC<PropsWithChildren> = ({ children }) => {
</StyledSpacer>
<MainContainerWrapper resizing={resizing} style={{ width: mainWidth }}>
<MainContainer className="main-container">
<AffineWorkspaceEffect />
{children}
<StyledToolWrapper>
{/* fixme(himself65): remove this */}