in chat application ,, Two friends x, y (used the same device) x Send to y message then stored in database x make log-out of the application and y log-in application and open chat and received the message here the message stored twice on the local storage and this is problem how to prevent duplicate storage on local storage ?
Jump to Post
Each user has a specific, unique, identifier, yes?
Pre-pend your root object with that decorator.
Can instead be:
Then your code can look for said data by something like:
localStorage[userID + "UserData"];
Mind you this is all pseudo code so you'll still have to do some work.…
All 4 Replies
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.