telescope

How to allow signed-in users to delete read items in telescopeapp?


How do I customise my telescope app, such that users can delete or hide an item if they don't want it to be included in the list anymore - for example, if they have already seen it and aren't interested in it. The list of items would then need to be re-ordered, so that the deleted item no longer shows, and all of the items below it are bumped up. I would want it to be possible for a user to delete all of the items individually if they wanted to, and then a message would be visible which would say that there are no items to show.

I essentially want to mimic the 'archive' function in Apple Mailbox where the email is no longer visible in a user's inbox.

Note: the user would only be deleting the item from his own view of the main list, this shouldn't affect the list that any other user can see.


Solution

  • It sounds like you need to add a couple things:

    The view would use the current user ID to retrieve the viewedPosts array from the user object, and then filter out any posts that are included in that array both on the server and client.