mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 08:52:26 +00:00
Change pluginRequirements file to requirements
This commit is contained in:
parent
5a1fae533a
commit
a033d97e34
@ -0,0 +1,3 @@
|
|||||||
|
const shouldRenderCompo = (plugin) => Promise.resolve(plugin);
|
||||||
|
|
||||||
|
export default shouldRenderCompo;
|
@ -0,0 +1,16 @@
|
|||||||
|
import AutoReloadBlocker from 'components/AutoReloadBlocker';
|
||||||
|
import request from 'utils/request';
|
||||||
|
|
||||||
|
const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => {
|
||||||
|
request('/content-type-builder/autoReload')
|
||||||
|
.then(response => {
|
||||||
|
plugin.preventComponentRendering = !response.autoReload;
|
||||||
|
plugin.blockerComponent = AutoReloadBlocker;
|
||||||
|
|
||||||
|
return resolve(plugin);
|
||||||
|
})
|
||||||
|
.catch(err => reject(err));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
export default shouldRenderCompo;
|
@ -0,0 +1,21 @@
|
|||||||
|
import AutoReloadBlocker from 'components/AutoReloadBlocker';
|
||||||
|
import ProductionBlocker from 'components/ProductionBlocker';
|
||||||
|
import request from 'utils/request';
|
||||||
|
|
||||||
|
const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => {
|
||||||
|
request('/settings-manager/autoReload')
|
||||||
|
.then(response => {
|
||||||
|
plugin.preventComponentRendering = !response.autoReload;
|
||||||
|
plugin.blockerComponent = AutoReloadBlocker;
|
||||||
|
|
||||||
|
if (response.environment !== 'development') {
|
||||||
|
plugin.preventComponentRendering = true;
|
||||||
|
plugin.blockerComponent = ProductionBlocker;
|
||||||
|
}
|
||||||
|
|
||||||
|
return resolve(plugin);
|
||||||
|
})
|
||||||
|
.catch(err => reject(err));
|
||||||
|
});
|
||||||
|
|
||||||
|
export default shouldRenderCompo;
|
Loading…
x
Reference in New Issue
Block a user