fix
This commit is contained in:
parent
1a71697266
commit
30446a29ce
|
|
@ -139,23 +139,21 @@ export const EdPropInstanceOptions: FC<{
|
|||
|
||||
useEffect(() => {
|
||||
if (local.metaFn) {
|
||||
if (local.metaFn && !local.loaded && !local.loading) {
|
||||
local.loading = true;
|
||||
try {
|
||||
const res = local.metaFn();
|
||||
const callback = (e: any) => {
|
||||
local.loading = false;
|
||||
local.loaded = e;
|
||||
local.render();
|
||||
};
|
||||
if (res instanceof Promise)
|
||||
res.then(callback).catch((e) => {
|
||||
console.error(e);
|
||||
});
|
||||
else callback(res);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
local.loading = true;
|
||||
try {
|
||||
const res = local.metaFn();
|
||||
const callback = (e: any) => {
|
||||
local.loading = false;
|
||||
local.loaded = e;
|
||||
local.render();
|
||||
};
|
||||
if (res instanceof Promise) {
|
||||
res.then(callback).catch((e) => {
|
||||
console.error(e);
|
||||
});
|
||||
} else callback(res);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
}, local.optDeps);
|
||||
|
|
|
|||
Loading…
Reference in New Issue