Commit e3852c9d by zhaochengxiang

bug fix

parent eefa27b7
......@@ -14,6 +14,7 @@ import ResourceItem from '../../AssetResourceManage/resource-item';
import { CancelSvg, EditSvg, SaveSvg, FullScreenSvg, CancelFullScreenSvg } from './AssetSvg';
import { Subject } from 'rxjs';
import { AssetDirectorySubject } from './AssetDirectory';
export const AssetActionSubject = new Subject();
......@@ -51,7 +52,17 @@ const AssetAction = (props) => {
setAssetParams({...assetParams, ...{assets: {}, attributes: []}});
getElements();
}
}
}
const $$assetDirectorySubject = AssetDirectorySubject.subscribe((props) => {
if (props.type === 'element-change' || props.type === 'element-value-change') {
getAsset()
}
})
return () => {
$$assetDirectorySubject.unsubscribe()
}
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [id, dirId])
......
......@@ -153,11 +153,9 @@ const FC = (props) => {
})
const $$assetDirectorySubject = AssetDirectorySubject.subscribe((props) => {
if (props.type === 'element-change') {
if (props.type === 'element-change' || props.type === 'element-value-change') {
getElements()
getAssets()
} else if (props.type === 'element-value-change') {
getAssets()
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment