From 22f4b357fc54c48d61bf183570fa2ee8af94531f Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 16 Mar 2022 21:33:44 -0400 Subject: [PATCH] Update NavigatorRoomCreator --- .../creator/NavigatorRoomCreatorView.tsx | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/components/navigator/views/creator/NavigatorRoomCreatorView.tsx b/src/components/navigator/views/creator/NavigatorRoomCreatorView.tsx index 6b76f0ac..0640cf9d 100644 --- a/src/components/navigator/views/creator/NavigatorRoomCreatorView.tsx +++ b/src/components/navigator/views/creator/NavigatorRoomCreatorView.tsx @@ -21,11 +21,9 @@ export const NavigatorRoomCreatorView: FC<{}> = props => const getRoomModelImage = (name: string) => GetConfiguration('images.url') + `/navigator/models/model_${ name }.png`; - const selectModel = (model: IRoomModel, index) => + const selectModel = (model: IRoomModel, index: number) => { - if(!model) return; - - if(model.clubLevel > GetClubMemberLevel()) return; + if(!model || (model.clubLevel > GetClubMemberLevel())) return; setSelectedModelName(RoomModels[index].name); } @@ -53,7 +51,7 @@ export const NavigatorRoomCreatorView: FC<{}> = props => useEffect(() => { - if(categories) setCategory(categories[0].id); + if(categories && categories.length) setCategory(categories[0].id); }, [ categories ]); return ( @@ -62,12 +60,16 @@ export const NavigatorRoomCreatorView: FC<{}> = props => { LocalizeText('navigator.createroom.roomnameinfo') } - setName(event.target.value) } /> + setName(event.target.value) } /> + + + { LocalizeText('navigator.createroom.roomdescinfo') } +