documentation
This commit is contained in:
parent
4e1d6f704d
commit
7c46ba462f
2 changed files with 56 additions and 1 deletions
|
|
@ -22,17 +22,41 @@ import {
|
||||||
import { isStatusNotification } from 'src/services/notification_utils/notification_utils_sw.js'
|
import { isStatusNotification } from 'src/services/notification_utils/notification_utils_sw.js'
|
||||||
|
|
||||||
export const defaultState = () => ({
|
export const defaultState = () => ({
|
||||||
|
// Prevents desktop notification spam on startup
|
||||||
desktopNotificationSilence: true,
|
desktopNotificationSilence: true,
|
||||||
|
|
||||||
|
// Pagination
|
||||||
maxId: '',
|
maxId: '',
|
||||||
minId: '',
|
minId: '',
|
||||||
|
|
||||||
|
// Order
|
||||||
data: [],
|
data: [],
|
||||||
|
|
||||||
|
// TODO: Implement!
|
||||||
|
// Useful for making notification as seen
|
||||||
|
// when interacting with status
|
||||||
statusNotificationRelations: new WeakMap(),
|
statusNotificationRelations: new WeakMap(),
|
||||||
|
|
||||||
|
// ID to Object notification
|
||||||
idStore: new Map(),
|
idStore: new Map(),
|
||||||
statusIdStore: new Set(),
|
|
||||||
|
// Reference to WS subscriber
|
||||||
socket: null,
|
socket: null,
|
||||||
|
|
||||||
|
// Indicates whether notifications receive push updates
|
||||||
streaming: false,
|
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,
|
fetching: true,
|
||||||
|
|
||||||
|
// Reference to fetcher, used for polling for new notifications
|
||||||
|
// and manually fetching old notifications
|
||||||
fetcher: null,
|
fetcher: null,
|
||||||
|
|
||||||
|
// Whether notifications fetcher has been paused - it stops fetching
|
||||||
|
// (but still receives pushes!)
|
||||||
paused: false,
|
paused: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,18 +8,49 @@ import { TIMELINE_STREAM_MAP, useStreamingStore } from 'src/stores/streaming.js'
|
||||||
|
|
||||||
const emptyTl = (name, argument = null) => {
|
const emptyTl = (name, argument = null) => {
|
||||||
const result = {
|
const result = {
|
||||||
|
// Name of the timeline. Useful for debugging and logging
|
||||||
name,
|
name,
|
||||||
|
|
||||||
|
// Order of statuses, important for timelines that
|
||||||
|
// have different ordering, i.e. bookmarks and favorites
|
||||||
order: [],
|
order: [],
|
||||||
|
|
||||||
|
// All statuses belonging to the timeline
|
||||||
statusIds: new Set(),
|
statusIds: new Set(),
|
||||||
|
|
||||||
|
// Statuses shown to user
|
||||||
visibleStatusIds: new Set(),
|
visibleStatusIds: new Set(),
|
||||||
|
|
||||||
|
// Number of statuses not shown yet
|
||||||
newStatusCount: 0,
|
newStatusCount: 0,
|
||||||
|
|
||||||
|
// Pagination
|
||||||
maxId: '',
|
maxId: '',
|
||||||
minId: '',
|
minId: '',
|
||||||
|
|
||||||
|
// Indicates whether timeline receives push updates
|
||||||
streaming: false,
|
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,
|
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,
|
reloadNeeded: false,
|
||||||
|
|
||||||
|
// Reference to fetcher, used for polling for new statuses and
|
||||||
|
// manually fetching old statuses
|
||||||
fetcher: null,
|
fetcher: null,
|
||||||
|
|
||||||
|
// Reference to WS subscriber
|
||||||
socket: null,
|
socket: null,
|
||||||
|
|
||||||
|
// Whether the timeline has been paused - it stops fetching
|
||||||
|
// (but still receives pushes!)
|
||||||
paused: false,
|
paused: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue