From a9d4bd15597c60a49852a91ec196c6ef4963e15b Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 30 Sep 2021 00:37:44 -0400 Subject: [PATCH] Select avatar on me menu click --- src/views/toolbar/me/ToolbarMeView.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/views/toolbar/me/ToolbarMeView.tsx b/src/views/toolbar/me/ToolbarMeView.tsx index d1128da7..510e68ef 100644 --- a/src/views/toolbar/me/ToolbarMeView.tsx +++ b/src/views/toolbar/me/ToolbarMeView.tsx @@ -1,4 +1,6 @@ -import { FC } from 'react'; +import { RoomObjectCategory } from '@nitrots/nitro-renderer'; +import { FC, useEffect } from 'react'; +import { GetRoomEngine, GetRoomSession } from '../../../api'; import { ToolbarViewItems } from '../ToolbarView.types'; import { ToolbarMeViewProps } from './ToolbarMeView.types'; @@ -6,6 +8,15 @@ export const ToolbarMeView: FC = props => { const { unseenAchievementCount = 0, handleToolbarItemClick = null } = props; + useEffect(() => + { + const roomSession = GetRoomSession(); + + if(!roomSession) return; + + GetRoomEngine().selectRoomObject(roomSession.roomId, roomSession.ownRoomIndex, RoomObjectCategory.UNIT); + }, []); + return (