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} myProfileDialogRef={myProfileDialogRef as any}
user={myUserProfileCache} /> user={myUserProfileCache} />
<UserProfileDialog <UserProfileDialog
chatInfoDialogRef={chatInfoDialogRef as any}
userProfileDialogRef={userProfileDialogRef as any} userProfileDialogRef={userProfileDialogRef as any}
openChatFragment={openChatFragment} openChatFragment={openChatFragment}
user={userInfo} /> user={userInfo} />

View File

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

View File

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