mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-26 15:40:51 +01:00
Fix friend issues
This commit is contained in:
parent
0a5b33ceda
commit
6a6d7f6947
@ -2,6 +2,6 @@ import { CreateLinkEvent } from '..';
|
||||
|
||||
export function OpenMessengerChat(friendId: number = 0): void
|
||||
{
|
||||
if(friendId === 0) CreateLinkEvent('friends-messenger/open');
|
||||
if(friendId === 0) CreateLinkEvent('friends-messenger/toggle');
|
||||
else CreateLinkEvent(`friends-messenger/${ friendId }`);
|
||||
}
|
||||
|
@ -49,15 +49,20 @@ export const FriendsMessengerView: FC<{}> = props =>
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
if(parts[1] === 'toggle')
|
||||
{
|
||||
const thread = getMessageThread(parseInt(parts[1]));
|
||||
setIsVisible(prevValue => !prevValue);
|
||||
|
||||
if(!thread) return;
|
||||
|
||||
setActiveThreadId(thread.threadId);
|
||||
setIsVisible(true);
|
||||
return;
|
||||
}
|
||||
|
||||
const thread = getMessageThread(parseInt(parts[1]));
|
||||
|
||||
if(!thread) return;
|
||||
|
||||
setActiveThreadId(thread.threadId);
|
||||
setIsVisible(true);
|
||||
}
|
||||
},
|
||||
eventUrlPrefix: 'friends-messenger/'
|
||||
|
@ -62,8 +62,6 @@ const useFriendRequestWidgetState = () =>
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
if(!requests || !requests.length) return;
|
||||
|
||||
const newDisplayedRequests: { roomIndex: number, request: MessengerRequest }[] = [];
|
||||
|
||||
for(const request of requests)
|
||||
|
Loading…
Reference in New Issue
Block a user