File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ const ShareModal: React.FC<ShareModalProps> = ({
232232 const handleShareWithNewUsers = async ( newUsers : User [ ] ) => {
233233 console . log ( "new users" , newUsers )
234234 const grantAccessList = newUsers . map ( user => ( {
235- actor_id : user . user_id ?? user . id ,
235+ actor_id : user . user_id ,
236236 actor_type : "user"
237237 } ) )
238238 const emails = newUsers . map ( u => u . email )
@@ -247,8 +247,6 @@ const ShareModal: React.FC<ShareModalProps> = ({
247247 }
248248 } )
249249
250-
251-
252250 if ( ! response ?. error ) {
253251 const msg = `${ dataName } shared with ${ emails . join ( ", " ) } ` ;
254252 notify ( {
Original file line number Diff line number Diff line change @@ -44,12 +44,14 @@ const UserShareSearch: React.FC<UserSearchFieldProps> = ({
4444 pagesize :10 ,
4545 } , { skip : debouncedInput . trim ( ) . length == 0 } )
4646
47- const suggestions = ( usersMatchingSearch ?. data ?? [ ] ) as User [ ]
4847
49- const open = inputValue . trim ( ) . length > 0 && suggestions ?. length > 0
48+ const suggestions = usersMatchingSearch ?. data ?? [ ] as User [ ]
49+
50+ // const open = inputValue.trim().length > 0 && suggestions?.length > 0
5051
5152
5253 const handleShareWithNewUsers = async ( ) => {
54+ console . log ( "users to share with" , usersToShareWith )
5355 try {
5456 setIsSharing ( true ) ;
5557 const result = await shareWithNewUsers ( usersToShareWith ) ;
@@ -87,6 +89,7 @@ const UserShareSearch: React.FC<UserSearchFieldProps> = ({
8789 ) ;
8890
8991
92+
9093 const isShareDisabled = disabled || isSharing || usersToShareWith . length === 0 ;
9194
9295 const UserChip = ( { avatarObj, ...props } : { avatarObj : User } ) => (
@@ -122,12 +125,12 @@ const UserShareSearch: React.FC<UserSearchFieldProps> = ({
122125 multiple
123126 disableListWrap
124127 disabled = { isSharing }
125- open = { open }
128+ // open={open}
126129 inputValue = { inputValue }
127130 loading = { searchUserLoading }
128131 value = { usersToShareWith }
129132 getOptionLabel = { ( user ) => user . email }
130- noOptionsText = { searchUserLoading ? 'Loading...' : 'No users found' }
133+ noOptionsText = { searchUserLoading ? 'Loading...' : ( inputValue == "" ? "Search using name or email" : 'No users found' ) }
131134 onChange = { handleAdd }
132135 onInputChange = { handleInputChange }
133136 isOptionEqualToValue = { ( option , value ) => option . email === value . email }
You can’t perform that action at this time.
0 commit comments