diff --git a/src/stores/notifications.js b/src/stores/notifications.js index 4f18ccc21..c69e9c164 100644 --- a/src/stores/notifications.js +++ b/src/stores/notifications.js @@ -22,17 +22,41 @@ import { import { isStatusNotification } from 'src/services/notification_utils/notification_utils_sw.js' export const defaultState = () => ({ + // Prevents desktop notification spam on startup desktopNotificationSilence: true, + + // Pagination maxId: '', minId: '', + + // Order data: [], + + // TODO: Implement! + // Useful for making notification as seen + // when interacting with status statusNotificationRelations: new WeakMap(), + + // ID to Object notification idStore: new Map(), - statusIdStore: new Set(), + + // Reference to WS subscriber socket: null, + + // Indicates whether notifications receive push updates streaming: false, + + // Indicates whether notifications are SUPPOSED to be fetching + // this is partiualrly useful for when pausing/resuming. I.e. + // whether we need to start fetching again if timeline was resumed. fetching: true, + + // Reference to fetcher, used for polling for new notifications + // and manually fetching old notifications fetcher: null, + + // Whether notifications fetcher has been paused - it stops fetching + // (but still receives pushes!) paused: false, }) diff --git a/src/stores/timelines.js b/src/stores/timelines.js index 834c29f50..bdd49d05c 100644 --- a/src/stores/timelines.js +++ b/src/stores/timelines.js @@ -8,18 +8,49 @@ import { TIMELINE_STREAM_MAP, useStreamingStore } from 'src/stores/streaming.js' const emptyTl = (name, argument = null) => { const result = { + // Name of the timeline. Useful for debugging and logging name, + + // Order of statuses, important for timelines that + // have different ordering, i.e. bookmarks and favorites order: [], + + // All statuses belonging to the timeline statusIds: new Set(), + + // Statuses shown to user visibleStatusIds: new Set(), + + // Number of statuses not shown yet newStatusCount: 0, + + // Pagination maxId: '', minId: '', + + // Indicates whether timeline receives push updates streaming: false, + + // Indicates whether timeline is SUPPOSED to be fetching + // this is partiualrly useful for when pausing/resuming + // timeline. I.e. whether we need to start fetching again + // if timeline was resumed. fetching: false, + + // Indicates that in recent poll update we've hit more than or + // equal to 20 statuses and most likely missed some statuses + // between polls reloadNeeded: false, + + // Reference to fetcher, used for polling for new statuses and + // manually fetching old statuses fetcher: null, + + // Reference to WS subscriber socket: null, + + // Whether the timeline has been paused - it stops fetching + // (but still receives pushes!) paused: false, }