commit: b5ca95235a1ee4587f88844739bc0bff80435435
parent 367783aeb3b8e5e67657f21095bf9331ae381940
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed, 27 Mar 2024 22:24:21 +0100
statuses.js: Yeet scrobbles
Diffstat:
1 file changed, 0 insertions(+), 17 deletions(-)
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
@@ -34,7 +34,6 @@ const emptyTl = (userId = 0) => ({
 
 export const defaultState = () => ({
   allStatuses: [],
-  scrobblesNextFetch: {},
   allStatusesObject: {},
   conversationsObject: {},
   maxId: 0,
@@ -107,24 +106,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