logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 3415c723a5c4c20f3c31636f2044b5a948ad0151
parent c02a83cab15a598bb3baa5ac4caf6897452ddcb0
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed, 27 Mar 2024 22:24:21 +0100

statuses.js: Yeet scrobbles

Diffstat:

Msrc/modules/statuses.js17-----------------
1 file changed, 0 insertions(+), 17 deletions(-)

diff --git a/src/modules/statuses.js b/src/modules/statuses.js @@ -33,7 +33,6 @@ const emptyTl = (userId = 0) => ({ export const defaultState = () => ({ allStatuses: [], - scrobblesNextFetch: {}, allStatusesObject: {}, conversationsObject: {}, maxId: 0, @@ -106,24 +105,8 @@ const sortTimeline = (timeline) => { return timeline } -const getLatestScrobble = (state, user) => { - if (state.scrobblesNextFetch[user.id] && state.scrobblesNextFetch[user.id] > Date.now()) { - return - } - - state.scrobblesNextFetch[user.id] = Date.now() + 24 * 60 * 60 * 1000 - apiService.fetchScrobbles({ accountId: user.id }).then((scrobbles) => { - if (scrobbles.length > 0) { - user.latestScrobble = scrobbles[0] - - state.scrobblesNextFetch[user.id] = Date.now() + 60 * 1000 - } - }) -} - // Add status to the global storages (arrays and objects maintaining statuses) except timelines const addStatusToGlobalStorage = (state, data) => { - getLatestScrobble(state, data.user) const result = mergeOrAdd(state.allStatuses, state.allStatusesObject, data) if (result.new) { // Add to conversation