mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:18:03 +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 { render } = useAppSpin();
|
||||
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 {
|
||||
async load() {
|
||||
this.addRoutes();
|
||||
this.addComponents();
|
||||
this.app.use(RemoteSchemaTemplateManagerProvider);
|
||||
}
|
||||
|
||||
addComponents() {
|
||||
|
Loading…
Reference in New Issue
Block a user