Skip to content

Commit

Permalink
added requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ishpaul777 committed Jan 10, 2024
1 parent 5041ea0 commit 325073d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/pages/KeyboardShortcutsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {chain, isEmpty} from 'lodash';
import React from 'react';
import {ScrollView, View} from 'react-native';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
Expand All @@ -14,20 +13,19 @@ import type {TranslationPaths} from '@src/languages/types';
function KeyboardShortcutsPage() {
const styles = useThemeStyles();
const {translate} = useLocalize();
const shortcuts = chain(CONST.KEYBOARD_SHORTCUTS)
.filter((shortcut) => !isEmpty(shortcut.descriptionKey))
const shortcuts = Object.values(CONST.KEYBOARD_SHORTCUTS)
.filter((shortcut) => shortcut.descriptionKey !== undefined && shortcut.descriptionKey !== null)
.map((shortcut) => {
const platformAdjustedModifiers = KeyboardShortcut.getPlatformEquivalentForKeys(shortcut.modifiers);
return {
displayName: KeyboardShortcut.getDisplayName(shortcut.shortcutKey, platformAdjustedModifiers),
descriptionKey: shortcut.descriptionKey,
};
})
.value();
});

type Shortcut = {
displayName: string;
descriptionKey: string | null; // Update the type to allow for null values
descriptionKey: string | null;
};
/**
* Render the information of a single shortcut
Expand Down

0 comments on commit 325073d

Please sign in to comment.