Digging in to the old implementation, I am wondering if this was a issue before as well…
const bottomAge = relativeAge(
new Date(topic.last_posted_at || topic.created_at),
{
addAgo: true,
defaultFormat: timelineDate,
}
);
const scroller = [
h(
"div.timeline-date-wrapper",
this.attach("link", {
className: "now-date",
rawLabel: bottomAge,
action: "jumpBottom",
})
),
];
This was called in the html() function of the widget, which it doesn’t look like we have any hooks for updating this as the time passes.
Obviously the desired functionality is to update the bottomAge with the newest date on post creation, and then continue to update it automatically as the time passes. What we can do right now is add a function to
and update bottomAge on scroll, but in practice feels a little odd. Another issue with this idea is that it is difficult to match the timing of the updating of the date on the latest post to the updating of the bottomAge date on the topic timeline. The relative created_at on a post lags behind by a 10 seconds or so… creating a miss match between
when you are scrolling.
Ideally we would track the relative post created_at date and just plug it in to the timeline, but I don’t know if this is possible atm.
@david, do you have any ideas?
