去死吧
This commit is contained in:
@@ -12,9 +12,10 @@ import SwitchPreference from "../preference/SwitchPreference"
|
|||||||
import TextFieldPreference from "../preference/TextFieldPreference"
|
import TextFieldPreference from "../preference/TextFieldPreference"
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import ChatMessageContainer from "./ChatMessageContainer"
|
import ChatMessageContainer from "./ChatMessageContainer"
|
||||||
|
import gotoChatInfo from "../routers/gotoChatInfo"
|
||||||
|
|
||||||
function gotoChatInfo(nav: NavigateFunction, id: string) {
|
function gotoChatInfo2(nav: NavigateFunction, id: string, useWithRouterChatFragment?: boolean) {
|
||||||
nav('/chat/info?id=' + id)
|
useWithRouterChatFragment ? nav('/chat/info?id=' + id) : gotoChatInfo(nav, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface MduiTabFitSizeArgs extends React.HTMLAttributes<HTMLElement & Tab> {
|
interface MduiTabFitSizeArgs extends React.HTMLAttributes<HTMLElement & Tab> {
|
||||||
@@ -100,13 +101,13 @@ export default function ChatFragment({
|
|||||||
marginRight: '5px',
|
marginRight: '5px',
|
||||||
}}></mdui-button-icon>
|
}}></mdui-button-icon>
|
||||||
<mdui-button-icon icon="refresh" onClick={() => {
|
<mdui-button-icon icon="refresh" onClick={() => {
|
||||||
|
|
||||||
}} style={{
|
}} style={{
|
||||||
alignSelf: 'center',
|
alignSelf: 'center',
|
||||||
marginLeft: '5px',
|
marginLeft: '5px',
|
||||||
marginRight: '5px',
|
marginRight: '5px',
|
||||||
}}></mdui-button-icon>
|
}}></mdui-button-icon>
|
||||||
<mdui-button-icon icon="info" onClick={() => gotoChatInfo(nav, chatInfo.getId())} style={{
|
<mdui-button-icon icon="info" onClick={() => gotoChatInfo2(nav, chatInfo.getId(), openedWithRouter)} style={{
|
||||||
alignSelf: 'center',
|
alignSelf: 'center',
|
||||||
marginLeft: '5px',
|
marginLeft: '5px',
|
||||||
marginRight: '5px',
|
marginRight: '5px',
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
import { Dialog } from 'mdui'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
const RouterDialogsContext = React.createContext(() => {})
|
const RouterDialogsContext = React.createContext((ref: React.MutableRefObject<Dialog>) => {})
|
||||||
|
|
||||||
export default RouterDialogsContext
|
export default RouterDialogsContext
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import RouterDialogsContext from './RouterDialogsContext'
|
|||||||
import { BlockerFunction, useBlocker, useNavigate } from "react-router"
|
import { BlockerFunction, useBlocker, useNavigate } from "react-router"
|
||||||
import sleep from "../../utils/sleep"
|
import sleep from "../../utils/sleep"
|
||||||
|
|
||||||
const routerDialogsList = []
|
const routerDialogsList: React.MutableRefObject<Dialog>[] = []
|
||||||
|
|
||||||
export default function RouterDialogsContextWrapper({ children }: React.HTMLAttributes<HTMLElement>) {
|
export default function RouterDialogsContextWrapper({ children }: React.HTMLAttributes<HTMLElement>) {
|
||||||
const proceedRef = React.useRef<() => void>()
|
const proceedRef = React.useRef<() => void>()
|
||||||
@@ -41,6 +41,9 @@ export default function RouterDialogsContextWrapper({ children }: React.HTMLAttr
|
|||||||
// 这个让姐姐来就好啦
|
// 这个让姐姐来就好啦
|
||||||
routerDialogsList.length != 0 && (routerDialogsList[routerDialogsList.length - 1].current!.open = false)
|
routerDialogsList.length != 0 && (routerDialogsList[routerDialogsList.length - 1].current!.open = false)
|
||||||
}
|
}
|
||||||
|
return () => {
|
||||||
|
blocker.reset?.()
|
||||||
|
}
|
||||||
}, [blocker.state])
|
}, [blocker.state])
|
||||||
|
|
||||||
// 注册
|
// 注册
|
||||||
|
|||||||
Reference in New Issue
Block a user