Skip to content

Commit 466c690

Browse files
committed
Make pause button work
1 parent 1d28cd6 commit 466c690

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/Debugger/Main.elm

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ type Msg msg
171171
| UserMsg msg
172172
| TweakExpandoMsg Expando.Msg
173173
| TweakExpandoModel Expando.Msg
174+
| Pause
174175
| Resume
175176
| Jump Int
176177
| SliderJump Int
@@ -234,6 +235,22 @@ wrapUpdate update msg model =
234235
, Cmd.none
235236
)
236237

238+
Pause ->
239+
case model.state of
240+
Running _ ->
241+
let
242+
size = History.size model.history
243+
in
244+
if size == 0 then
245+
( model, Cmd.none )
246+
else
247+
( jumpUpdate update (size - 1) model
248+
, Cmd.none
249+
)
250+
251+
Paused _ _ userModel userMsg _ ->
252+
( model, Cmd.none )
253+
237254
Resume ->
238255
case model.state of
239256
Running _ ->
@@ -686,7 +703,7 @@ viewPlayButton playing =
686703
, style "cursor" "pointer"
687704
, style "width" "36px"
688705
, style "height" "36px"
689-
, onClick Resume
706+
, onClick (if playing then Pause else Resume)
690707
]
691708
[ if playing
692709
then icon "M2 2h4v12h-4v-12z M10 2h4v12h-4v-12z"

0 commit comments

Comments
 (0)