ui: 用户资料中进入对话, 连带上层对话框关闭

This commit is contained in:
CrescentLeaf
2025-10-04 15:52:22 +08:00
parent a77e22a3ea
commit ad4e873d2f
3 changed files with 5 additions and 0 deletions

View File

@@ -145,6 +145,7 @@ export default function App() {
myProfileDialogRef={myProfileDialogRef as any}
user={myUserProfileCache} />
<UserProfileDialog
chatInfoDialogRef={chatInfoDialogRef as any}
userProfileDialogRef={userProfileDialogRef as any}
openChatFragment={openChatFragment}
user={userInfo} />

View File

@@ -169,6 +169,7 @@ export default function AppMobile() {
myProfileDialogRef={myProfileDialogRef as any}
user={myUserProfileCache} />
<UserProfileDialog
chatInfoDialogRef={chatInfoDialogRef as any}
userProfileDialogRef={userProfileDialogRef as any}
openChatFragment={openChatFragment}
user={userInfo} />

View File

@@ -11,12 +11,14 @@ import User from "../../api/client_data/User.ts"
interface Refs {
userProfileDialogRef: React.MutableRefObject<Dialog>
chatInfoDialogRef: React.MutableRefObject<Dialog>
openChatFragment: (id: string) => void
user: User
}
export default function UserProfileDialog({
userProfileDialogRef,
chatInfoDialogRef,
openChatFragment,
user
}: Refs) {
@@ -51,6 +53,7 @@ export default function UserProfileDialog({
openChatFragment(re.data!.chat_id as string)
userProfileDialogRef.current!.open = false
chatInfoDialogRef.current!.open = false
}}></mdui-list-item>
</mdui-list>
</mdui-dialog>