Skip to content

Commit 491e0c1

Browse files
subpath relative route in app editor
1 parent a2110ec commit 491e0c1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

client/packages/lowcoder/src/pages/editor/AppEditor.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { AppState } from "@lowcoder-ee/redux/reducers";
3737
import { resetIconDictionary } from "@lowcoder-ee/constants/iconConstants";
3838
import {fetchJsDSPaginationByApp} from "@lowcoder-ee/util/pagination/axios";
3939
import PaginationComp from "@lowcoder-ee/util/pagination/Pagination";
40+
import history from "@lowcoder-ee/util/history";
4041

4142
const AppSnapshot = lazy(() => {
4243
return import("pages/editor/appSnapshot")
@@ -67,12 +68,12 @@ const AppEditor = React.memo(() => {
6768
// Memoize selectors to prevent unnecessary re-renders
6869
const selectors = useMemo(() => ({
6970
isUserViewMode: params.viewMode ? isUserViewModeCheck : true,
70-
applicationId: params.applicationId || window.location.pathname.split("/")[2],
71-
paramViewMode: params.viewMode || window.location.pathname.split("/")[3],
71+
applicationId: params.applicationId || history.location.pathname.split("/")[2],
72+
paramViewMode: params.viewMode || history.location.pathname.split("/")[3],
7273
viewMode: (params.viewMode === "view" || params.viewMode === "admin")
7374
? "published"
7475
: params.viewMode === "view_marketplace" ? "view_marketplace" : "editing",
75-
}), [params.viewMode, params.applicationId, window.location.pathname, isUserViewModeCheck]);
76+
}), [params.viewMode, params.applicationId, history.location.pathname, isUserViewModeCheck]);
7677

7778
const firstRendered = useRef(false);
7879
const orgId = useMemo(() => currentUser.currentOrgId, [currentUser.currentOrgId]);

0 commit comments

Comments
 (0)