File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ const ShareModal: React.FC<ShareModalProps> = ({
232
232
const handleShareWithNewUsers = async ( newUsers : User [ ] ) => {
233
233
console . log ( "new users" , newUsers )
234
234
const grantAccessList = newUsers . map ( user => ( {
235
- actor_id : user . user_id ?? user . id ,
235
+ actor_id : user . user_id ,
236
236
actor_type : "user"
237
237
} ) )
238
238
const emails = newUsers . map ( u => u . email )
@@ -247,8 +247,6 @@ const ShareModal: React.FC<ShareModalProps> = ({
247
247
}
248
248
} )
249
249
250
-
251
-
252
250
if ( ! response ?. error ) {
253
251
const msg = `${ dataName } shared with ${ emails . join ( ", " ) } ` ;
254
252
notify ( {
Original file line number Diff line number Diff line change @@ -44,12 +44,14 @@ const UserShareSearch: React.FC<UserSearchFieldProps> = ({
44
44
pagesize :10 ,
45
45
} , { skip : debouncedInput . trim ( ) . length == 0 } )
46
46
47
- const suggestions = ( usersMatchingSearch ?. data ?? [ ] ) as User [ ]
48
47
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
50
51
51
52
52
53
const handleShareWithNewUsers = async ( ) => {
54
+ console . log ( "users to share with" , usersToShareWith )
53
55
try {
54
56
setIsSharing ( true ) ;
55
57
const result = await shareWithNewUsers ( usersToShareWith ) ;
@@ -87,6 +89,7 @@ const UserShareSearch: React.FC<UserSearchFieldProps> = ({
87
89
) ;
88
90
89
91
92
+
90
93
const isShareDisabled = disabled || isSharing || usersToShareWith . length === 0 ;
91
94
92
95
const UserChip = ( { avatarObj, ...props } : { avatarObj : User } ) => (
@@ -122,12 +125,12 @@ const UserShareSearch: React.FC<UserSearchFieldProps> = ({
122
125
multiple
123
126
disableListWrap
124
127
disabled = { isSharing }
125
- open = { open }
128
+ // open={open}
126
129
inputValue = { inputValue }
127
130
loading = { searchUserLoading }
128
131
value = { usersToShareWith }
129
132
getOptionLabel = { ( user ) => user . email }
130
- noOptionsText = { searchUserLoading ? 'Loading...' : 'No users found' }
133
+ noOptionsText = { searchUserLoading ? 'Loading...' : ( inputValue == "" ? "Search using name or email" : 'No users found' ) }
131
134
onChange = { handleAdd }
132
135
onInputChange = { handleInputChange }
133
136
isOptionEqualToValue = { ( option , value ) => option . email === value . email }
You can’t perform that action at this time.
0 commit comments