Fetch friends list on chat page load to resolve friend name after refresh

This commit is contained in:
2026-03-11 22:10:23 -07:00
parent 2e77f9372d
commit adcf7b07ac
+5 -1
View File
@@ -28,7 +28,7 @@ export default function Chat() {
emitTyping,
clearChat,
} = useChatStore();
const { friends } = useFriendsStore();
const { friends, fetchFriends } = useFriendsStore();
const [input, setInput] = useState('');
const [sending, setSending] = useState(false);
@@ -62,6 +62,10 @@ export default function Chat() {
return;
}
if (friends.length === 0) {
fetchFriends();
}
if (friendId) {
connect();
openConversation(friendId);