From 513b3b6bcc0c215b75bd11fd8b8d01ea217b3b49 Mon Sep 17 00:00:00 2001 From: ObjectRetro Date: Wed, 16 Mar 2022 05:42:20 +0100 Subject: [PATCH] Fix select room model --- .../navigator/views/creator/NavigatorRoomCreatorView.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/navigator/views/creator/NavigatorRoomCreatorView.tsx b/src/components/navigator/views/creator/NavigatorRoomCreatorView.tsx index 0c438e0b..6b76f0ac 100644 --- a/src/components/navigator/views/creator/NavigatorRoomCreatorView.tsx +++ b/src/components/navigator/views/creator/NavigatorRoomCreatorView.tsx @@ -21,13 +21,13 @@ export const NavigatorRoomCreatorView: FC<{}> = props => const getRoomModelImage = (name: string) => GetConfiguration('images.url') + `/navigator/models/model_${ name }.png`; - const selectModel = (model: IRoomModel) => + const selectModel = (model: IRoomModel, index) => { if(!model) return; if(model.clubLevel > GetClubMemberLevel()) return; - setSelectedModelName(name); + setSelectedModelName(RoomModels[index].name); } const createRoom = () => @@ -97,9 +97,9 @@ export const NavigatorRoomCreatorView: FC<{}> = props => { - RoomModels.map(model => + RoomModels.map((model, index )=> { - return ( selectModel(model) } itemActive={ (selectedModelName === model.name) } overflow="unset" gap={ 0 } className="p-1" disabled={ (GetClubMemberLevel() < model.clubLevel) }> + return ( selectModel(model, index) } itemActive={ (selectedModelName === model.name) } overflow="unset" gap={ 0 } className="p-1" disabled={ (GetClubMemberLevel() < model.clubLevel) }>