import { useDispatch, useSelector } from 'tgui/backend'; import { Box, LabeledList, NumberInput, Section } from 'tgui-core/components'; import { toFixed } from 'tgui-core/math'; import { useGame } from '../../game'; import { updateSettings } from '../actions'; import { selectSettings } from '../selectors'; export const MessageLimits = (props) => { const dispatch = useDispatch(); const game = useGame(); const { visibleMessageLimit, persistentMessageLimit, combineMessageLimit, combineIntervalLimit, saveInterval, } = useSelector(selectSettings); return (
toFixed(value)} onDrag={(value) => dispatch( updateSettings({ visibleMessageLimit: value, }), ) } />   {visibleMessageLimit >= 5000 && ( Impacts performance! )} toFixed(value)} onDrag={(value) => dispatch( updateSettings({ persistentMessageLimit: value, }), ) } />   {persistentMessageLimit >= 2500 && ( Delays initialization! )} toFixed(value)} onDrag={(value) => dispatch( updateSettings({ combineMessageLimit: value, }), ) } /> toFixed(value)} onDrag={(value) => dispatch( updateSettings({ combineIntervalLimit: value, }), ) } /> {!game.databaseBackendEnabled && ( toFixed(value)} onDrag={(value) => dispatch( updateSettings({ saveInterval: value, }), ) } />   {saveInterval <= 3 && ( Warning, experimental! Might crash! )} )}
); };