fix: show ctrl as mod button in shortcut modal for windows devices
This commit is contained in:
Manoj Vivek 2024-01-22 15:02:10 +05:30 committed by GitHub
commit ba4dd5e314
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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