Skip to content

Commit

Permalink
refactor to remove else clause
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert committed Nov 20, 2023
1 parent 388bd0a commit 491ef43
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/tvshows/TVEpisodes.bs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ end sub

' get the currently focused item
function getFocusedItem() as dynamic
if isValid(m.top.focusedChild) and isValid(m.top.focusedChild.focusedChild)
focusedChild = m.top.focusedChild.focusedChild
if not isValid(focusedChild.content) then return invalid
m.top.lastFocus = focusedChild
else
if not isValid(m.top.focusedChild) or not isValid(m.top.focusedChild.focusedChild)
return invalid
end if

focusedChild = m.top.focusedChild.focusedChild
if not isValid(focusedChild.content) then return invalid
m.top.lastFocus = focusedChild

if isValidAndNotEmpty(focusedChild.rowItemFocused)
itemToPlay = focusedChild.content.getChild(focusedChild.rowItemFocused[0]).getChild(0)
if isValid(itemToPlay) and isValidAndNotEmpty(itemToPlay.id)
Expand Down

0 comments on commit 491ef43

Please sign in to comment.