Client:Packages:Shared: fix redirect between pages wizard and unavailable
This commit is contained in:
parent
55fcbe3849
commit
d7d48ec228
@ -36,6 +36,7 @@ import type { PublicRouteProps } from "./Routers.types";
|
||||
|
||||
export const PublicRoute = (props: PublicRouteProps) => {
|
||||
const {
|
||||
isFirstLoaded,
|
||||
wizardCompleted,
|
||||
isAuthenticated,
|
||||
tenantStatus,
|
||||
@ -89,8 +90,12 @@ export const PublicRoute = (props: PublicRouteProps) => {
|
||||
/>
|
||||
);
|
||||
}
|
||||
if (!wizardCompleted && location.pathname !== "/wizard") {
|
||||
return <Navigate replace to="/wizard" />;
|
||||
|
||||
if (isFirstLoaded && !wizardCompleted && location.pathname !== "/wizard") {
|
||||
window.location.replace(
|
||||
combineUrl(window.ClientConfig?.proxy?.url, "/wizard"),
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (
|
||||
|
@ -64,5 +64,8 @@ export interface PublicRouteProps
|
||||
Pick<AuthStore, "isAuthenticated">,
|
||||
Pick<
|
||||
SettingsStore,
|
||||
"wizardCompleted" | "tenantStatus" | "isPortalDeactivate"
|
||||
| "wizardCompleted"
|
||||
| "tenantStatus"
|
||||
| "isPortalDeactivate"
|
||||
| "isFirstLoaded"
|
||||
> {}
|
||||
|
@ -96,6 +96,8 @@ const isDesktopEditors = window.AscDesktopEditor !== undefined;
|
||||
const systemTheme = getSystemTheme();
|
||||
|
||||
class SettingsStore {
|
||||
isFirstLoaded = false;
|
||||
|
||||
isLoading = false;
|
||||
|
||||
interfaceDirection = "";
|
||||
@ -659,6 +661,7 @@ class SettingsStore {
|
||||
|
||||
this.setIsLoading(false);
|
||||
this.setIsLoaded(true);
|
||||
this.setIsFirstLoaded(true);
|
||||
};
|
||||
|
||||
setRoomsMode = (mode: boolean) => {
|
||||
@ -673,6 +676,10 @@ class SettingsStore {
|
||||
this.isLoaded = isLoaded;
|
||||
};
|
||||
|
||||
setIsFirstLoaded = (isFirstLoaded: boolean) => {
|
||||
this.isFirstLoaded = isFirstLoaded;
|
||||
};
|
||||
|
||||
setCultures = (cultures: string[]) => {
|
||||
this.cultures = cultures;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user