Add header to group clip clops (#10254)
Co-authored-by: Samuel Newman <mozzius@protonmail.com>
This commit is contained in:
@@ -153,6 +153,8 @@ export class Convo {
|
||||
sender: this.sender,
|
||||
recipients: this.recipients,
|
||||
isFetchingHistory: this.isFetchingHistory,
|
||||
// Explicit null check since the value is initially undefined.
|
||||
hasAllHistory: this.oldestRev === null,
|
||||
deleteMessage: undefined,
|
||||
sendMessage: undefined,
|
||||
fetchMessageHistory: undefined,
|
||||
@@ -176,6 +178,8 @@ export class Convo {
|
||||
sender: this.sender!,
|
||||
recipients: this.recipients!,
|
||||
isFetchingHistory: this.isFetchingHistory,
|
||||
// Explicit null check since the value is initially undefined.
|
||||
hasAllHistory: this.oldestRev === null,
|
||||
deleteMessage: this.deleteMessage,
|
||||
sendMessage: this.sendMessage,
|
||||
fetchMessageHistory: this.fetchMessageHistory,
|
||||
@@ -196,6 +200,7 @@ export class Convo {
|
||||
sender: undefined,
|
||||
recipients: undefined,
|
||||
isFetchingHistory: false,
|
||||
hasAllHistory: false,
|
||||
deleteMessage: undefined,
|
||||
sendMessage: undefined,
|
||||
fetchMessageHistory: undefined,
|
||||
@@ -216,6 +221,8 @@ export class Convo {
|
||||
sender: this.sender,
|
||||
recipients: this.recipients,
|
||||
isFetchingHistory: false,
|
||||
// Explicit null check since the value is initially undefined.
|
||||
hasAllHistory: this.oldestRev === null,
|
||||
deleteMessage: undefined,
|
||||
sendMessage: undefined,
|
||||
fetchMessageHistory: undefined,
|
||||
@@ -627,6 +634,7 @@ export class Convo {
|
||||
|
||||
/*
|
||||
* If oldestRev is null, we've fetched all history.
|
||||
* Needs to explicitly check for `null` since this is initially `undefined`.
|
||||
*/
|
||||
if (this.oldestRev === null) return
|
||||
|
||||
@@ -660,6 +668,14 @@ export class Convo {
|
||||
|
||||
this.oldestRev = cursor ?? null
|
||||
|
||||
/*
|
||||
* If the response contained fewer messages than the limit, we know
|
||||
* there are no more pages, regardless of whether a cursor was returned.
|
||||
*/
|
||||
if (messages.length < (IS_NATIVE ? 30 : 60)) {
|
||||
this.oldestRev = null
|
||||
}
|
||||
|
||||
for (const message of messages) {
|
||||
if (
|
||||
ChatBskyConvoDefs.isMessageView(message) ||
|
||||
|
||||
@@ -156,6 +156,7 @@ export type ConvoStateUninitialized = {
|
||||
sender: ChatBskyActorDefs.ProfileViewBasic | undefined
|
||||
recipients: ChatBskyActorDefs.ProfileViewBasic[] | undefined
|
||||
isFetchingHistory: false
|
||||
hasAllHistory: boolean
|
||||
deleteMessage: undefined
|
||||
sendMessage: undefined
|
||||
fetchMessageHistory: undefined
|
||||
@@ -174,6 +175,7 @@ export type ConvoStateInitializing = {
|
||||
sender: ChatBskyActorDefs.ProfileViewBasic | undefined
|
||||
recipients: ChatBskyActorDefs.ProfileViewBasic[] | undefined
|
||||
isFetchingHistory: boolean
|
||||
hasAllHistory: boolean
|
||||
deleteMessage: undefined
|
||||
sendMessage: undefined
|
||||
fetchMessageHistory: undefined
|
||||
@@ -192,6 +194,7 @@ export type ConvoStateReady = {
|
||||
sender: ChatBskyActorDefs.ProfileViewBasic
|
||||
recipients: ChatBskyActorDefs.ProfileViewBasic[]
|
||||
isFetchingHistory: boolean
|
||||
hasAllHistory: boolean
|
||||
deleteMessage: DeleteMessage
|
||||
sendMessage: SendMessage
|
||||
fetchMessageHistory: FetchMessageHistory
|
||||
@@ -210,6 +213,7 @@ export type ConvoStateBackgrounded = {
|
||||
sender: ChatBskyActorDefs.ProfileViewBasic
|
||||
recipients: ChatBskyActorDefs.ProfileViewBasic[]
|
||||
isFetchingHistory: boolean
|
||||
hasAllHistory: boolean
|
||||
deleteMessage: DeleteMessage
|
||||
sendMessage: SendMessage
|
||||
fetchMessageHistory: FetchMessageHistory
|
||||
@@ -228,6 +232,7 @@ export type ConvoStateSuspended = {
|
||||
sender: ChatBskyActorDefs.ProfileViewBasic
|
||||
recipients: ChatBskyActorDefs.ProfileViewBasic[]
|
||||
isFetchingHistory: boolean
|
||||
hasAllHistory: boolean
|
||||
deleteMessage: DeleteMessage
|
||||
sendMessage: SendMessage
|
||||
fetchMessageHistory: FetchMessageHistory
|
||||
@@ -246,6 +251,7 @@ export type ConvoStateError = {
|
||||
sender: undefined
|
||||
recipients: undefined
|
||||
isFetchingHistory: false
|
||||
hasAllHistory: false
|
||||
deleteMessage: undefined
|
||||
sendMessage: undefined
|
||||
fetchMessageHistory: undefined
|
||||
@@ -264,6 +270,7 @@ export type ConvoStateDisabled = {
|
||||
sender: ChatBskyActorDefs.ProfileViewBasic
|
||||
recipients: ChatBskyActorDefs.ProfileViewBasic[]
|
||||
isFetchingHistory: boolean
|
||||
hasAllHistory: boolean
|
||||
deleteMessage: DeleteMessage
|
||||
sendMessage: SendMessage
|
||||
fetchMessageHistory: FetchMessageHistory
|
||||
|
||||
Reference in New Issue
Block a user