Optimize loading stories

This commit is contained in:
Fedor Indutny 2022-11-28 09:19:48 -08:00 committed by GitHub
parent a827cb7c4e
commit d6d53f9d18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 87 additions and 86 deletions

View file

@ -353,6 +353,13 @@ export type GetKnownMessageAttachmentsResultType = Readonly<{
attachments: ReadonlyArray<string>;
}>;
export type GetAllStoriesResultType = ReadonlyArray<
MessageType & {
hasReplies: boolean;
hasRepliesFromSelf: boolean;
}
>;
export type DataInterface = {
close: () => Promise<void>;
removeDB: () => Promise<void>;
@ -520,9 +527,7 @@ export type DataInterface = {
getAllStories: (options: {
conversationId?: string;
sourceUuid?: UUIDStringType;
}) => Promise<Array<MessageType>>;
hasStoryReplies: (storyId: string) => Promise<boolean>;
hasStoryRepliesFromSelf: (storyId: string) => Promise<boolean>;
}) => Promise<GetAllStoriesResultType>;
// getNewerMessagesByConversation is JSON on server, full message on Client
getMessageMetricsForConversation: (
conversationId: string,