Select avatar on me menu click

This commit is contained in:
Bill 2021-09-30 00:37:44 -04:00
parent ff5f1d8038
commit a9d4bd1559

View File

@ -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 { ToolbarViewItems } from '../ToolbarView.types';
import { ToolbarMeViewProps } from './ToolbarMeView.types'; import { ToolbarMeViewProps } from './ToolbarMeView.types';
@ -6,6 +8,15 @@ export const ToolbarMeView: FC<ToolbarMeViewProps> = props =>
{ {
const { unseenAchievementCount = 0, handleToolbarItemClick = null } = props; const { unseenAchievementCount = 0, handleToolbarItemClick = null } = props;
useEffect(() =>
{
const roomSession = GetRoomSession();
if(!roomSession) return;
GetRoomEngine().selectRoomObject(roomSession.roomId, roomSession.ownRoomIndex, RoomObjectCategory.UNIT);
}, []);
return ( return (
<div className="d-flex nitro-toolbar-me px-1 py-2"> <div className="d-flex nitro-toolbar-me px-1 py-2">
<div className="navigation-items"> <div className="navigation-items">