From ca3bea8e03ed4325fb5b042a95f73b8be07a65a3 Mon Sep 17 00:00:00 2001 From: Steven Vandevelde Date: Wed, 6 Mar 2019 15:20:42 +0100 Subject: [PATCH] Cause a short delay when importing data so we're sure the loading animation is shown --- src/Applications/UI.elm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Applications/UI.elm b/src/Applications/UI.elm index 54f2cf0a..23f92c0c 100644 --- a/src/Applications/UI.elm +++ b/src/Applications/UI.elm @@ -20,6 +20,7 @@ import Html.Styled.Lazy as Lazy import Json.Decode import Json.Encode import Notifications +import Process import Replying as N5 exposing (do, return) import Return2 as R2 import Sources @@ -351,7 +352,10 @@ update msg model = Import file -> ( { model | isLoading = True } - , Task.perform ImportJson (File.toString file) + , 250 + |> Process.sleep + |> Task.andThen (\_ -> File.toString file) + |> Task.perform ImportJson ) ImportJson json -> -- 2.51.2