Hi!
I'm facing a problem, which I'm making to be the problem instead of leaving it as it is. I decided to add lazy loading, infinite scrolling for performance.
Namely I choose a user and let's say I have 200 messages in total, on my current instant the 200 messages load, I would like a certain number of messages to load first and when the user wants to go back to the previous messages to load the messages, one after the other.
I've tried several variants, I've looked at how others do it, but I just don't do anything right, I mean I do everything wrong and I don't know how to do it, I've tried but nothing, everything is a mess.
I feel a bit stupid to post on the forum, I know how wrong the code is, it's really bad, but I don't have another option, I don't feel like it.
it is possible that the message text is not displayed + possible if you try to send a message, because I have an .env file where I specified a decryption key.
In the master branch it's a totally different code, as I've made changes to it, but the code is not commented out. In MainPage I made changes in the Chat folder for optimization + lazy loading on messages. It looks cleaner code in the master :((
Git repo : https://github.com/Andrei6700/Chat-App-License.git
Branch : MainPage
Where: src/Chat/components/Messages.jsx
Test accounts:
user: [email protected]
pass: [email protected]
user: [email protected]
pass: [email protected]