File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
implement/example-apps/elm-editor/src/FrontendWeb Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -211,11 +211,21 @@ update event stateBefore =
211
211
stateBefore |> update ( UserInputChangeTextInEditor content)
212
212
213
213
FrontendWeb . MonacoEditor . CompletedSetupEvent ->
214
- ( stateBefore
215
- , stateBefore. fileInEditor
216
- |> Maybe . map ( Tuple . second >> setTextInMonacoEditorCmd)
217
- |> Maybe . withDefault Cmd . none
218
- )
214
+ case stateBefore. fileInEditor of
215
+ Nothing ->
216
+ ( stateBefore, Cmd . none )
217
+
218
+ Just fileInEditor ->
219
+ let
220
+ ( state, compileCmd ) =
221
+ update UserInputCompile stateBefore
222
+ in
223
+ ( state
224
+ , [ fileInEditor |> Tuple . second |> setTextInMonacoEditorCmd
225
+ , compileCmd
226
+ ]
227
+ |> Cmd . batch
228
+ )
219
229
220
230
FrontendWeb . MonacoEditor . EditorActionCloseFileEvent ->
221
231
( { stateBefore | fileInEditor = Nothing }
You can’t perform that action at this time.
0 commit comments