From 9af557cb3f308dfc80b2f621834178bee9eb34dd Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 1 Aug 2022 12:05:00 -0400 Subject: [PATCH] Fix room settings --- .../room-settings/NavigatorRoomSettingsModTabView.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/navigator/views/room-settings/NavigatorRoomSettingsModTabView.tsx b/src/components/navigator/views/room-settings/NavigatorRoomSettingsModTabView.tsx index 2bf48c2a..fb71db16 100644 --- a/src/components/navigator/views/room-settings/NavigatorRoomSettingsModTabView.tsx +++ b/src/components/navigator/views/room-settings/NavigatorRoomSettingsModTabView.tsx @@ -1,4 +1,4 @@ -import { BannedUserData, BannedUsersFromRoomEvent, RoomBannedUsersComposer, RoomUnbanUserComposer } from '@nitrots/nitro-renderer'; +import { BannedUserData, BannedUsersFromRoomEvent, RoomBannedUsersComposer, RoomModerationSettings, RoomUnbanUserComposer } from '@nitrots/nitro-renderer'; import { FC, useCallback, useEffect, useState } from 'react'; import { IRoomData, LocalizeText, SendMessageComposer } from '../../../../api'; import { Button, Column, Flex, Grid, Text, UserProfileIconView } from '../../../../common'; @@ -73,25 +73,25 @@ export const NavigatorRoomSettingsModTabView: FC { LocalizeText('navigator.roomsettings.moderation.mute.header') } - handleChange('moderation_mute', (event.target.checked ? 1 : 0)) } /> + handleChange('moderation_mute', (event.target.checked ? RoomModerationSettings.MODERATION_LEVEL_USER_WITH_RIGHTS : RoomModerationSettings.MODERATION_LEVEL_NONE)) } /> { LocalizeText('navigator.roomsettings.moderation.rights') } { LocalizeText('navigator.roomsettings.moderation.kick.header') } - handleChange('moderation_kick', (event.target.checked ? 0 : 2)) } /> + handleChange('moderation_kick', (event.target.checked ? RoomModerationSettings.MODERATION_LEVEL_ALL : RoomModerationSettings.MODERATION_LEVEL_NONE)) } /> { LocalizeText('navigator.roomsettings.moderation.all') } - handleChange('moderation_kick', (event.target.checked ? 1 : 2)) } /> + = RoomModerationSettings.MODERATION_LEVEL_USER_WITH_RIGHTS) } disabled={ (roomData.moderationSettings.allowKick === RoomModerationSettings.MODERATION_LEVEL_ALL) } onChange={ event => handleChange('moderation_kick', (event.target.checked ? RoomModerationSettings.MODERATION_LEVEL_USER_WITH_RIGHTS : RoomModerationSettings.MODERATION_LEVEL_NONE)) } /> { LocalizeText('navigator.roomsettings.moderation.rights') } { LocalizeText('navigator.roomsettings.moderation.ban.header') } - handleChange('moderation_ban', (event.target.checked ? 1 : 0)) } /> + handleChange('moderation_ban', (event.target.checked ? RoomModerationSettings.MODERATION_LEVEL_USER_WITH_RIGHTS : RoomModerationSettings.MODERATION_LEVEL_NONE)) } /> { LocalizeText('navigator.roomsettings.moderation.rights') }