File tree Expand file tree Collapse file tree
frontend/web/components/modals Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,7 +145,11 @@ const CreateSegment: FC<CreateSegmentType> = ({
145145 const [ description , setDescription ] = useState ( segment . description )
146146 const [ name , setName ] = useState < Segment [ 'name' ] > ( segment . name )
147147 const [ rules , setRules ] = useState < Segment [ 'rules' ] > ( segment . rules )
148-
148+ useEffect ( ( ) => {
149+ if ( _segment ) {
150+ setSegment ( _segment )
151+ }
152+ } , [ _segment ] )
149153 useEffect ( ( ) => {
150154 if ( segment ) {
151155 setRules ( segment . rules )
@@ -538,22 +542,20 @@ const CreateSegment: FC<CreateSegmentType> = ({
538542 />
539543 </ div >
540544 </ TabItem >
541- < TabItem tabLabel = 'Users ' >
545+ < TabItem tabLabel = 'Identities ' >
542546 < div className = 'my-4' >
543- { ! ! identities && (
544- < CreateSegmentUsersTabContent
545- projectId = { projectId }
546- environmentId = { environmentId }
547- setEnvironmentId = { setEnvironmentId }
548- identitiesLoading = { identitiesLoading }
549- identities = { identities }
550- page = { page }
551- setPage = { setPage }
552- name = { name }
553- searchInput = { searchInput }
554- setSearchInput = { setSearchInput }
555- />
556- ) }
547+ < CreateSegmentUsersTabContent
548+ projectId = { projectId }
549+ environmentId = { environmentId }
550+ setEnvironmentId = { setEnvironmentId }
551+ identitiesLoading = { identitiesLoading }
552+ identities = { identities }
553+ page = { page }
554+ setPage = { setPage }
555+ name = { name }
556+ searchInput = { searchInput }
557+ setSearchInput = { setSearchInput }
558+ />
557559 </ div >
558560 </ TabItem >
559561 { metadataEnable && segmentContentType ?. id && (
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ interface CreateSegmentUsersTabContentProps {
1717 environmentId : string
1818 setEnvironmentId : ( environmentId : string ) => void
1919 identitiesLoading : boolean
20- identities : Res [ 'identities' ]
20+ identities : Res [ 'identities' ] | undefined
2121 page : any
2222 setPage : ( page : any ) => void
2323 name : string
You can’t perform that action at this time.
0 commit comments