fix(splash): select the latest history message
This commit is contained in:
@@ -11,6 +11,6 @@ export async function fetchSplashLatestMessagePreview(): Promise<
|
||||
const result = await getChatRepository().getHistory(1, 0);
|
||||
if (Result.isErr(result)) return Result.err(result.error);
|
||||
|
||||
const latestMessage = result.data.messages[1] ?? null;
|
||||
const latestMessage = result.data.messages.at(-1) ?? null;
|
||||
return Result.ok(getSplashLatestMessagePreview(latestMessage));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user