mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:47:10 +00:00
fix: template list provider bug (#3950)
This commit is contained in:
parent
e81cfcbe98
commit
89b73ba389
@ -122,7 +122,7 @@ export const useSchemaTemplateManager = () => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const Internal = (props) => {
|
export const RemoteSchemaTemplateManagerProvider = (props) => {
|
||||||
const api = useAPIClient();
|
const api = useAPIClient();
|
||||||
const { render } = useAppSpin();
|
const { render } = useAppSpin();
|
||||||
const options = {
|
const options = {
|
||||||
@ -153,19 +153,10 @@ const Internal = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const RemoteSchemaTemplateManagerProvider: React.FC<{ children?: ReactNode }> = (props) => {
|
|
||||||
const location = useLocation();
|
|
||||||
if (location.pathname.startsWith('/admin')) {
|
|
||||||
return <Internal {...props} />;
|
|
||||||
}
|
|
||||||
return <>{props.children}</>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export class RemoteSchemaTemplateManagerPlugin extends Plugin {
|
export class RemoteSchemaTemplateManagerPlugin extends Plugin {
|
||||||
async load() {
|
async load() {
|
||||||
this.addRoutes();
|
this.addRoutes();
|
||||||
this.addComponents();
|
this.addComponents();
|
||||||
this.app.use(RemoteSchemaTemplateManagerProvider);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addComponents() {
|
addComponents() {
|
||||||
|
Loading…
Reference in New Issue
Block a user