Comments (7)
Not such a bad idea - we would only need to know the last time they viewed the comments for a particular item and then just see if there are any new comments since that date.
from pullup.
I think a simple way to do it would be have a list of users who have seen the comments on that item. When a new comment is added, clear the list.
It's doesn't add any database calls when viewing the home page.
from pullup.
i'm working on this right now. It adds the date of the latest comment and name of the latest commenter to the news item object, and sets it in the view as data items in the comment link. I'm planning to use session storage (maybe) to check that when the document loads in main.js.
from pullup.
@kennethrapp wouldn't it make more sense to use localStorage?
from pullup.
Probably.
Since I clearly can't decide on anything I just removed storage entirely pending further discussion, since I don't know what the best solution in node would be for that. I don't want to contribute to bloat too much. It just shows the time of the latest comment.
from pullup.
@sriehl editing the same array in mongodb at the same time (which would be the case any time two users viewed a story at the same time) can be tricky. Only the $push
and $addToSet
operators work for this purpose, and I'm generally wary of editing the story for what is fundamentally an attribute of the user.
@chall8908 I actually think localStorage is not the right answer for this since it wouldn't translate across devices. I know that's fairly small potatoes, but I'd rather design for a multi-device world at the outset.
from pullup.
I think this was addressed, at least for the time being, by using a query string in the url to the comments page (#246). That way your browser shows the comments link as a new one if there have been new comments since your last visit. It certainly isn't a comprehensive solution, but it's simple and gets the job done.
from pullup.
Related Issues (20)
- Footer is not anchored to the bottom of the page HOT 5
- Better mobile views HOT 1
- Consider having a goal to focus on. HOT 4
- Landing page still visible after login HOT 1
- Justify GitHub Auth permission to read/write my repositories HOT 6
- A new idea for PullUp HOT 16
- Help: Issue deploying to heroku HOT 2
- Autocomplete username in comments HOT 3
- Update README.md: no need to include quotes around env variables when exporting them HOT 1
- Pullup as a reddit style layer for pull requests and issues. HOT 8
- [RFC] Switch from Gitter to Slack
- [LINKS] Domain not parsed on this submission HOT 1
- [PROFILE] Add contributions to mobile
- Add margin between error message and join alert HOT 2
- Make comments linkable
- Submit News button is misaligned HOT 3
- Hide upvote button if already upvoted
- On mobile: Vertically center vote count when there's no upvote
- Comment deleting needs a backend check
- Help me
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pullup.