FreeTubeApp / FreeTube

An Open Source YouTube app for privacy
https://freetubeapp.io/
GNU Affero General Public License v3.0
13.37k stars 825 forks source link

[Feature Request]: Have refresh timestamp on the subscriptions page update on an interval #5140

Open kommunarr opened 5 months ago

kommunarr commented 5 months ago

Guidelines

Problem Description

Sometimes I leave FreeTube on in the background and like to see how long it's been since my last refresh. The problem is that the top bar doesn't refresh with the newest relative timestamp, so I have to switch to a new tab and back again to see the updated timestamp.

Proposed Solution

Using setInterval, have the refresh widget timestamp update on an interval. Some questions that could take this feature into different directions:

  1. How long should the interval be (e.g., 1 minute, 5 minutes)?
  2. Do we update the video / live / short / community post timestamps on that interval too for consistency?

My thoughts:

  1. 1 minute (makes sense, as the main discernible visual unit for the first hour, that it update on that basis)
  2. No, I think if it's just the refresh timestamps, that makes sense on it's own. I don't think we want to violate the long-standing idea of these timestamps being unchanging as of first load, especially when we don't do the same behavior on other views.

Alternatives Considered

Issue Labels

ease of use improvement, improvement to existing feature

Additional Information

No response

H0onnn commented 5 months ago

I would like to resolve the issue if possible.

efb4f5ff-1298-471a-8973-3d47447115dc commented 4 months ago

Hi @H0onnn just checking in. What is you current status on this?

manohar-nalluri commented 2 months ago

Hi,I am working on this and usually i came across some problem Usally i have changed the state logic to the children javascript getLastRefreshTimestamp: { type: Function, default: (_) => true } as a prop updateLastRefreshTimestamp: function() { this.lastRefreshTimestamp = this.getLastRefreshTimestamp() }, startTimer: function() { if (this.timmerId) { clearInterval(this.timmerId) this.timmerId = null } this.timmerId = setInterval(() => { this.updateLastRefreshTimestamp() }, 60000) }, methods to update the state so its work fine with every widget but problem when the refresh is clicked that too only in most popular it takes some time while fetching the data but i am updating it click: function() { this.$emit('click') setTimeout(()=>{this.fetchLastRefreshTimestamp()},3000) } immediately after the click so it is not immediately updating it updates based on setInterval so for this i need to keep state in parent so is there any best practices i can do it improve it any suggestions i am new to this kind of stuff any help regarding it