移除路由动画试图保留行为, 杂物
This commit is contained in:
@@ -22,7 +22,7 @@ export default function ChatFragmentDialog() {
|
||||
const body = shadow.querySelector(".body") as HTMLElement
|
||||
body.style.height = '100%'
|
||||
body.style.display = 'flex'
|
||||
}, [])
|
||||
})
|
||||
|
||||
return (<>
|
||||
<mdui-dialog fullscreen ref={dialogRef}>
|
||||
|
||||
@@ -23,8 +23,6 @@ export default function UserOrChatInfoDialog() {
|
||||
(context: Shared) => context.setCurrentSelectedChatId
|
||||
)
|
||||
|
||||
console.log(setCurrentSelectedChatId, favouriteChats)
|
||||
|
||||
const nav = useNavigate()
|
||||
|
||||
const dialogRef = useRouterDialogRef()
|
||||
|
||||
@@ -7,8 +7,12 @@ import RouterDialogsContext from './RouterDialogsContext'
|
||||
|
||||
export default function useRouterDialogRef() {
|
||||
const dialogRef = React.useRef<Dialog>()
|
||||
const nav = useNavigate()
|
||||
|
||||
useAsyncEffect(async () => {
|
||||
dialogRef.current!.addEventListener('closed', async () => {
|
||||
nav(-1)
|
||||
})
|
||||
await sleep(10)
|
||||
dialogRef.current!.open = true
|
||||
}, [])
|
||||
|
||||
Reference in New Issue
Block a user