From 24f5ba34c8ddc8627fb1cc6ce62e4eb3ecb1ad42 Mon Sep 17 00:00:00 2001 From: Kirill Shumilov Date: Tue, 27 Jun 2017 20:52:42 +0300 Subject: [PATCH] fix(xod-client-electron): fix `loadTargetBoard` could return selected board (from settings) or Null --- packages/xod-client-electron/src/app/arduinoActions.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/xod-client-electron/src/app/arduinoActions.js b/packages/xod-client-electron/src/app/arduinoActions.js index 999d5a18a..d79da5870 100644 --- a/packages/xod-client-electron/src/app/arduinoActions.js +++ b/packages/xod-client-electron/src/app/arduinoActions.js @@ -41,16 +41,13 @@ export const getListOfBoards = R.compose( /** * Returns a target Board. * It tries to take a value from Settings, if it doesn't exist - * it will fallback to the first Board from listOfBoards. + * it will just return Null */ -// :: () -> Board +// :: () -> Nullable Board export const loadTargetBoard = () => R.compose( R.when( R.either(R.isNil, R.isEmpty), - R.compose( - R.head, - getListOfBoards - ) + R.always(null) ), settings.getArduinoTarget, settings.load