|
@@ -19,7 +19,7 @@ import { apiBatchLink } from '@/services/customer'
|
|
|
|
|
|
|
|
const Contact = props => {
|
|
const Contact = props => {
|
|
|
const { toggleDrawer, setDrawerProps } = useModal()
|
|
const { toggleDrawer, setDrawerProps } = useModal()
|
|
|
- const { personTagColorMap, teamTagColorMap, personTags, teamTags, dispatch } = props
|
|
|
|
|
|
|
+ const { personTagColorMap, teamTagColorMap, personTags, teamTags, dispatch, shouldUpdate } = props
|
|
|
|
|
|
|
|
const tRef = useRef()
|
|
const tRef = useRef()
|
|
|
const [tagState, setTagState] = useState({
|
|
const [tagState, setTagState] = useState({
|
|
@@ -66,7 +66,7 @@ const Contact = props => {
|
|
|
}, [personTags, teamTags, personTagColorMap, teamTagColorMap])
|
|
}, [personTags, teamTags, personTagColorMap, teamTagColorMap])
|
|
|
|
|
|
|
|
const toolbarOptionsChange = (type, ids) => {
|
|
const toolbarOptionsChange = (type, ids) => {
|
|
|
- console.log('type', type, 'ids', ids)
|
|
|
|
|
|
|
+ // console.log('type', type, 'ids', ids)
|
|
|
setTagState({ ...tagState, [type]: ids })
|
|
setTagState({ ...tagState, [type]: ids })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -409,7 +409,14 @@ const Contact = props => {
|
|
|
payload: { tagType: TagTypeEnum.TEAMTAG, tagColumn: TagDataTypeEnum.CONTACT }
|
|
payload: { tagType: TagTypeEnum.TEAMTAG, tagColumn: TagDataTypeEnum.CONTACT }
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- }, [])
|
|
|
|
|
|
|
+ if (shouldUpdate) {
|
|
|
|
|
+ tRef.current.reload()
|
|
|
|
|
+ dispatch({
|
|
|
|
|
+ type: 'refresh/contact',
|
|
|
|
|
+ payload: 'contact'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }, [shouldUpdate])
|
|
|
|
|
|
|
|
const handleSearch = value => {
|
|
const handleSearch = value => {
|
|
|
tRef.current.reset()
|
|
tRef.current.reset()
|
|
@@ -573,9 +580,10 @@ const Contact = props => {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export default connect(({ contact }) => ({
|
|
|
|
|
|
|
+export default connect(({ contact, refresh }) => ({
|
|
|
personTagColorMap: contact.personTagColorMap,
|
|
personTagColorMap: contact.personTagColorMap,
|
|
|
personTags: contact.personTags,
|
|
personTags: contact.personTags,
|
|
|
teamTagColorMap: contact.teamTagColorMap,
|
|
teamTagColorMap: contact.teamTagColorMap,
|
|
|
- teamTags: contact.teamTags
|
|
|
|
|
|
|
+ teamTags: contact.teamTags,
|
|
|
|
|
+ shouldUpdate: refresh.contact
|
|
|
}))(Contact)
|
|
}))(Contact)
|