chatify
chatify copied to clipboard
ISSUES WITH STARTING A CHART
WHEN I SELECT A USER IT JUS LOADS AS ENDS LIKE THANT .IT CAN NOT INTIATE TO START A CONVERSATION
+1 to fix this issue!
@etumaini963 @Qoraiche please provide more details. In this way I can not reproduce the issue. Details like: logs, requests' response if any errors there, Laravel and Chatify version..etc
@etumaini963 @Qoraiche please provide more details. In this way I can not reproduce the issue. Details like: logs, requests' response if any errors there, Laravel and Chatify version..etc
Sure, basically when you click to initiate a chat conversation with a user, chatify pushes the window state to a new URL (/chatify/1) which is the user ID, and then loads the messages of that user. but when you reload the page with the current ID it won't load the messages automatically as it should.
This is a simple js code I've created to fix it:
function loadUserFromURL() {
// Get the current URL
const url = window.location.pathname;
// Assuming your URL looks like /chatify/1, extract the userID
const parts = url.split("/");
const userID = parts[parts.length - 1];
// Check if the userID is a number (or validate it in your own way)
if (userID && !isNaN(userID)) {
updateSelectedContact(userID);
setMessengerId(userID);
IDinfo(userID);
}
}
Thanks, I hope this helps.
@Qoraiche You can open a PR and then I will review your changes to merge if everything goes well.
@Qoraiche You can open a PR and then I will review your changes to merge if everything goes well.
I've pushed a fix PR: https://github.com/munafio/chatify/pull/374
merged #374
I was saying that, when i select a user, the system does not intiate a chat.... what i ,en is that when i select a recipient to start a chart ..... it loads but does not intiate the conversation i need you help... what have i not done