File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
src/smart-components/CreateChannel/components/InviteUsers Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 66 ESM library should have "type": "module" (package.json file that is going to /dist)
77 This fixes Cannot use import outside module issue in next.js
88* Add optional chaining for createApplicationUserList
9+ * Fix QueryInProgress warning:
10+ React 18 strict mode glitch that causes useEffect to run twice
911* Cannot connect sometimes when customApiHost is empty
1012 Connection couldnt be established with no error message when customApiHost and customWebSocketHost
1113 were passed as empty string
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ const InviteUsers: React.FC<InviteUsersProps> = ({
4141 const globalStore = useSendbirdStateContext ( ) ;
4242 const userId = globalStore ?. config ?. userId ;
4343 const sdk = globalStore ?. stores ?. sdkStore ?. sdk as SendbirdGroupChat ;
44+ const logger = globalStore ?. config ?. logger ;
4445 const idsToFilter = [ userId ] ;
4546 const [ users , setUsers ] = useState ( [ ] ) ;
4647 const [ selectedUsers , setSelectedUsers ] = useState ( { } ) ;
@@ -55,9 +56,12 @@ const InviteUsers: React.FC<InviteUsersProps> = ({
5556 useEffect ( ( ) => {
5657 const applicationUserListQuery = userQueryCreator ;
5758 setUsersDataSource ( applicationUserListQuery ) ;
58- applicationUserListQuery . next ( ) . then ( ( users_ ) => {
59- setUsers ( users_ ) ;
60- } ) ;
59+ // @ts -ignore
60+ if ( ! applicationUserListQuery ?. isLoading ) {
61+ applicationUserListQuery . next ( ) . then ( ( users_ ) => {
62+ setUsers ( users_ ) ;
63+ } ) ;
64+ }
6165 } , [ ] ) ;
6266
6367 return (
You can’t perform that action at this time.
0 commit comments