Apply corrections identified by SonarQube (#8457)

This commit is contained in:
Michael Telatynski 2022-05-03 22:04:37 +01:00 committed by GitHub
parent 99cb83a9df
commit 964c60d086
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
73 changed files with 211 additions and 232 deletions

View file

@ -15,14 +15,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { isMac, Key } from "./Keyboard";
import { IS_MAC, Key } from "./Keyboard";
import SettingsStore from "./settings/SettingsStore";
import SdkConfig from "./SdkConfig";
import {
IKeyBindingsProvider,
KeyBinding,
KeyCombo,
} from "./KeyBindingsManager";
import { IKeyBindingsProvider, KeyBinding } from "./KeyBindingsManager";
import {
CATEGORIES,
CategoryName,
@ -31,13 +27,10 @@ import {
import { getKeyboardShortcuts } from "./accessibility/KeyboardShortcutUtils";
export const getBindingsByCategory = (category: CategoryName): KeyBinding[] => {
return CATEGORIES[category].settingNames.reduce((bindings, name) => {
const value = getKeyboardShortcuts()[name]?.default;
if (value) {
bindings.push({
action: name as KeyBindingAction,
keyCombo: value as KeyCombo,
});
return CATEGORIES[category].settingNames.reduce((bindings, action) => {
const keyCombo = getKeyboardShortcuts()[action]?.default;
if (keyCombo) {
bindings.push({ action, keyCombo });
}
return bindings;
}, []);
@ -81,7 +74,7 @@ const messageComposerBindings = (): KeyBinding[] => {
shiftKey: true,
},
});
if (isMac) {
if (IS_MAC) {
bindings.push({
action: KeyBindingAction.NewLine,
keyCombo: {