Commit e3852c9d by zhaochengxiang

bug fix

parent eefa27b7
...@@ -14,6 +14,7 @@ import ResourceItem from '../../AssetResourceManage/resource-item'; ...@@ -14,6 +14,7 @@ import ResourceItem from '../../AssetResourceManage/resource-item';
import { CancelSvg, EditSvg, SaveSvg, FullScreenSvg, CancelFullScreenSvg } from './AssetSvg'; import { CancelSvg, EditSvg, SaveSvg, FullScreenSvg, CancelFullScreenSvg } from './AssetSvg';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { AssetDirectorySubject } from './AssetDirectory';
export const AssetActionSubject = new Subject(); export const AssetActionSubject = new Subject();
...@@ -52,6 +53,16 @@ const AssetAction = (props) => { ...@@ -52,6 +53,16 @@ const AssetAction = (props) => {
getElements(); 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 //eslint-disable-next-line react-hooks/exhaustive-deps
}, [id, dirId]) }, [id, dirId])
......
...@@ -153,11 +153,9 @@ const FC = (props) => { ...@@ -153,11 +153,9 @@ const FC = (props) => {
}) })
const $$assetDirectorySubject = AssetDirectorySubject.subscribe((props) => { const $$assetDirectorySubject = AssetDirectorySubject.subscribe((props) => {
if (props.type === 'element-change') { if (props.type === 'element-change' || props.type === 'element-value-change') {
getElements() getElements()
getAssets() 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