Add server message parser validation

This commit is contained in:
Gerzon Z 2021-08-22 21:30:30 -04:00
parent 81c0d322c3
commit 73f4e815c0
2 changed files with 15 additions and 9 deletions

View File

@ -202,5 +202,8 @@ export default {
},
Jitsi_Enable_Channels: {
type: 'valuesAsBoolean'
},
Accounts_Default_User_Preferences_enableMessageParserEarlyAdoption: {
type: 'valueAsBoolean'
}
};

View File

@ -17,6 +17,7 @@ import RocketChat from '../../lib/rocketchat';
const UserPreferencesView = ({ navigation }) => {
const user = useSelector(state => getUserSelector(state));
const isMessageParserServerEnabled = useSelector(state => state.settings.Accounts_Default_User_Preferences_enableMessageParserEarlyAdoption);
const [enableParser, setEnableParser] = useState(user.enableMessageParserEarlyAdoption);
useEffect(() => {
@ -61,15 +62,17 @@ const UserPreferencesView = ({ navigation }) => {
/>
<List.Separator />
</List.Section>
<List.Section>
<List.Separator />
<List.Item
title='Enable_Message_Parser'
testID='preferences-view-enable-message-parser'
right={() => renderMessageParserSwitch()}
/>
<List.Separator />
</List.Section>
{isMessageParserServerEnabled && (
<List.Section>
<List.Separator />
<List.Item
title='Enable_Message_Parser'
testID='preferences-view-enable-message-parser'
right={() => renderMessageParserSwitch()}
/>
<List.Separator />
</List.Section>
)}
</List.Container>
</SafeAreaView>
);