移除路由动画试图保留行为, 杂物

This commit is contained in:
CrescentLeaf
2025-12-27 00:49:16 +08:00
parent 2ad2e6e863
commit 1e2e90f9e7
6 changed files with 10 additions and 16 deletions

View File

@@ -3,19 +3,10 @@ import { Await } from "react-router"
import getClient from "../../getClient"
import ChatFragment from "./ChatFragment"
import * as React from 'react'
import showSnackbar from "../../utils/showSnackbar"
import EffectOnly from "../EffectOnly"
export default function LazyChatFragment({ chatId, openedWithRouter }: { chatId: string, openedWithRouter: boolean }) {
return <React.Suspense fallback={<EffectOnly effect={() => {
const s = showSnackbar({
message: '请稍后...',
autoCloseDelay: 0,
})
return () => {
s.open = false
}
}} deps={[]} />}>
return <React.Suspense fallback={<EffectOnly effect={() => {}} deps={[]} />}>
<Await
resolve={React.useMemo(() => Chat.getByIdOrThrow(getClient(), chatId), [chatId])}
children={(chatInfo: Chat) => <ChatFragment chatInfo={chatInfo} openedWithRouter={openedWithRouter} />} />