feat(splash): load latest chat message
Docker Image / Build and Push Docker Image (push) Has been cancelled

This commit is contained in:
2026-07-08 17:31:58 +08:00
parent 75aa084095
commit baf0deeb24
7 changed files with 268 additions and 4 deletions
+16
View File
@@ -0,0 +1,16 @@
"use client";
import { getChatRepository } from "@/data/repositories/chat_repository";
import { Result, type Result as ResultT } from "@/utils";
import { getSplashLatestMessagePreview } from "./splash_latest_message_preview";
export async function fetchSplashLatestMessagePreview(): Promise<
ResultT<string | null>
> {
const result = await getChatRepository().getHistory(1, 0);
if (Result.isErr(result)) return Result.err(result.error);
const latestMessage = result.data.messages[0] ?? null;
return Result.ok(getSplashLatestMessagePreview(latestMessage));
}