fix(lint): resolve floating promise warnings
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user