chatify icon indicating copy to clipboard operation
chatify copied to clipboard

ISSUES WITH STARTING A CHART

Open etumaini963 opened this issue 1 year ago • 3 comments

WHEN I SELECT A USER IT JUS LOADS AS ENDS LIKE THANT .IT CAN NOT INTIATE TO START A CONVERSATION Screenshot (2)

etumaini963 avatar Oct 16 '24 12:10 etumaini963

+1 to fix this issue!

Qoraiche avatar Oct 18 '24 03:10 Qoraiche

@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

munafio avatar Oct 18 '24 03:10 munafio

@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 avatar Oct 19 '24 03:10 Qoraiche

@Qoraiche You can open a PR and then I will review your changes to merge if everything goes well.

munafio avatar Oct 21 '24 00:10 munafio

@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

Qoraiche avatar Oct 21 '24 21:10 Qoraiche

merged #374

munafio avatar Oct 22 '24 17:10 munafio

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

etumaini963 avatar Nov 14 '24 15:11 etumaini963