fix: show ctrl as mod button in shortcut modal

This commit is contained in:
surajbobade 2024-01-19 22:57:29 +05:30
parent 47f982775c
commit 228607cbea

View file

@ -5,8 +5,16 @@ interface Props {
const ShortcutButton = ({ text }: Props) => {
const btnText = text[0].split('+');
const btnTextLength = btnText.length - 1;
const { platform = '' } = navigator?.userAgentData || {};
const formatText = (value: string) => {
if (value === 'mod') return ``;
if (value === 'mod') {
if (platform.includes('Windows')) {
return `Ctrl`;
}
return ``;
}
if (value.length === 1) return value.toUpperCase();
return value;
};