diff options
author | Joris Guyonvarch | 2015-03-21 17:54:44 +0100 |
---|---|---|
committer | Joris Guyonvarch | 2015-03-21 17:54:44 +0100 |
commit | ced86444353617a9eef0f940401348ee41f05aca (patch) | |
tree | aedf98ac44705ab0e7c3b7620a9853966c48372d /src/View | |
parent | d57ea4eda1339ae55f1f1f6341d1af6b1a690330 (diff) |
Do not validate time edition if the user did not prodive any numbers, and show the current time if there are no numbers
Diffstat (limited to 'src/View')
-rw-r--r-- | src/View/Timer.elm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/View/Timer.elm b/src/View/Timer.elm index 4523334..ca5edc6 100644 --- a/src/View/Timer.elm +++ b/src/View/Timer.elm @@ -9,6 +9,7 @@ import String import Time (Time) import Signal import Maybe +import List import Model.Model (..) import Model.Timer (..) @@ -56,7 +57,12 @@ timeBlock model (id, timer) = [ class "time block edition" , onClick (stopIfRinging (id, timer) (Signal.send updates ValidTimerEdition)) ] - [ text (editionView edition.numbers) ] + [ if List.isEmpty edition.numbers + then + text (timeView timer.currentTime) + else + text (editionView edition.numbers) + ] Nothing -> button [ class "time block" |