fix(lint): resolve floating promise warnings

This commit is contained in:
zetaloop
2026-03-01 22:53:48 +08:00
parent 05c5d05148
commit aae83bce44
9 changed files with 59 additions and 45 deletions
+6 -4
View File
@@ -29,8 +29,10 @@ export default function ChatDetailPage({ params }: { params: Promise<{ id: strin
useEffect(() => {
let cancelled = false
setLoading(true)
Promise.all([Promise.resolve(getChatSessionById(id)), Promise.resolve(listChatMessages(id))])
void Promise.all([
Promise.resolve(getChatSessionById(id)),
Promise.resolve(listChatMessages(id)),
])
.then(([nextSession, nextMessages]) => {
if (cancelled) return
setSession(nextSession)
@@ -177,7 +179,7 @@ export default function ChatDetailPage({ params }: { params: Promise<{ id: strin
if (!file) return
const imageUrl = URL.createObjectURL(file)
Promise.resolve(sendImageMessage(session.id, imageUrl))
void Promise.resolve(sendImageMessage(session.id, imageUrl))
.then((result) => {
if (!result.ok) {
notifyInfo(result.error.msg)
@@ -197,7 +199,7 @@ export default function ChatDetailPage({ params }: { params: Promise<{ id: strin
const text = input.trim()
if (!text) return
Promise.resolve(sendTextMessage(session.id, text)).then((result) => {
void Promise.resolve(sendTextMessage(session.id, text)).then((result) => {
if (!result.ok) {
notifyInfo(result.error.msg)
return