Content-Length: 5850 | pFad | http://github.com/lowcoder-org/lowcoder/pull/712.diff
thub.com
diff --git a/client/packages/lowcoder/src/pages/ApplicationV2/HomeLayout.tsx b/client/packages/lowcoder/src/pages/ApplicationV2/HomeLayout.tsx
index ff6b6cf27..eccd53b21 100644
--- a/client/packages/lowcoder/src/pages/ApplicationV2/HomeLayout.tsx
+++ b/client/packages/lowcoder/src/pages/ApplicationV2/HomeLayout.tsx
@@ -34,7 +34,7 @@ import { isFetchingFolderElements } from "../../redux/selectors/folderSelector";
import { checkIsMobile } from "util/commonUtils";
import MarketplaceHeaderImage from "assets/images/marketplaceHeaderImage.jpg";
import { Divider } from "antd";
-import { Margin } from "../setting/theme/styledComponents";
+import { Margin } from "../setting/theme/styledComponents";
const Wrapper = styled.div`
display: flex;
@@ -239,6 +239,7 @@ const LayoutSwitcher = styled.div`
}
`;
+
function showNewUserGuide(user: User) {
return (
user.orgDev &&
@@ -278,7 +279,7 @@ export function HomeLayout(props: HomeLayoutProps) {
const { breadcrumb = [], elements = [], localMarketplaceApps = [], globalMarketplaceApps = [],mode } = props;
const user = useSelector(getUser);
const isFetching = useSelector(isFetchingFolderElements);
-
+ const isSelfHost = window.location.host !== 'app.lowcoder.cloud';
const [filterBy, setFilterBy] = useState("All");
const [searchValue, setSearchValue] = useState("");
const [layout, setLayout] = useState(
@@ -294,14 +295,16 @@ export function HomeLayout(props: HomeLayoutProps) {
}
var displayElements = elements;
- if (mode === "marketplace") {
+ if (mode === "marketplace" && isSelfHost) {
const markedLocalApps = localMarketplaceApps.map(app => ({ ...app, isLocalMarketplace: true }));
const markedGlobalApps = globalMarketplaceApps.map(app => ({ ...app, isLocalMarketplace: false }));
// Merge local and global apps into the elements array
displayElements = [...markedLocalApps, ...markedGlobalApps];
}
-
- console.log("HomeLayout: displayElements", displayElements);
+ else if (mode === "marketplace") {
+ const markedLocalApps = localMarketplaceApps.map(app => ({ ...app, isLocalMarketplace: true }));
+ displayElements = [...markedLocalApps];
+ }
const resList: HomeRes[] = displayElements
.filter((e) =>
@@ -454,19 +457,37 @@ export function HomeLayout(props: HomeLayoutProps) {
<>
{layout === "list" ? (
<>
- {trans("home.localMarketplaceTitle")}
- app.isLocalMarketplace)} />
-
- {trans("home.globalMarketplaceTitle")}
- !app.isLocalMarketplace)} />
+ {isSelfHost ? (
+ <>
+ {trans("home.localMarketplaceTitle")}
+ app.isLocalMarketplace)} />
+
+ {trans("home.globalMarketplaceTitle")}
+ !app.isLocalMarketplace)} />
+ >
+ ) : (
+ <>
+ {trans("home.globalMarketplaceTitle")}
+ app.isLocalMarketplace)} />
+ >
+ )}
>
) : (
- <>
- {trans("home.localMarketplaceTitle")}
- app.isLocalMarketplace)} />
-
- {trans("home.globalMarketplaceTitle")}
- !app.isLocalMarketplace)} />
+ <>
+ {isSelfHost ? (
+ <>
+ {trans("home.localMarketplaceTitle")}
+ app.isLocalMarketplace)} />
+
+ {trans("home.globalMarketplaceTitle")}
+ !app.isLocalMarketplace)} />
+ >
+ ) : (
+ <>
+ {trans("home.globalMarketplaceTitle")}
+ app.isLocalMarketplace)} />
+ >
+ )}
>
)}
>
--- a PPN by Garber Painting Akron. With Image Size Reduction included!Fetched URL: http://github.com/lowcoder-org/lowcoder/pull/712.diff
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy