documentation

This commit is contained in:
Henry Jameson 2026-08-26 18:35:10 +03:00
commit 7c46ba462f
2 changed files with 56 additions and 1 deletions

View file

@ -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,
})

View file

@ -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,
}