From d4dc998b2b0bc1c322fe1aab5aad55b55f29c255 Mon Sep 17 00:00:00 2001
From: "Aamon P. Hoffmann" <aamon.hoffmann@student.uni-halle.de>
Date: Sun, 5 Jan 2025 13:32:17 +0100
Subject: [PATCH] fix not showing spinner when changin views (for real now)

---
 src/Main.elm                     |  2 +-
 src/Views/ForceDirectedGraph.elm | 13 +++++--------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/Main.elm b/src/Main.elm
index 8574e61..279c58b 100644
--- a/src/Main.elm
+++ b/src/Main.elm
@@ -95,7 +95,7 @@ update msg ( global, local ) =
                         loadingfdg =
                             { fdg | loading = True }
                     in
-                    ( ( { global | view = newView }, local )
+                    ( ( { global | view = newView }, { local | forcedirectedgraph = loadingfdg } )
                     , ForceDirectedGraphView.calculateModel global.data loadingfdg |> Cmd.map ForceDirectedGraphView.propagate
                     )
 
diff --git a/src/Views/ForceDirectedGraph.elm b/src/Views/ForceDirectedGraph.elm
index 2e4fef3..28180e7 100644
--- a/src/Views/ForceDirectedGraph.elm
+++ b/src/Views/ForceDirectedGraph.elm
@@ -404,14 +404,11 @@ postInit data local =
         list =
             Force.computeSimulation (Force.simulation forces) <| List.map .label <| Graph.nodes graph
     in
-    Task.succeed (Ok { firstInit | loading = True })
-        |> Task.andThen
-            (\_ ->
-                Task.succeed
-                    (Ok
-                        (Local.Model (updateGraphWithList graph list) (Force.simulation forces) 0 False "" 0 0)
-                    )
-            )
+    Task.succeed
+        (Ok
+            --(Local.Model (updateGraphWithList graph list) (Force.simulation forces) 0 True "" 0 0)
+            { local | graph = updateGraphWithList graph list, simulation = Force.simulation forces, loading = True }
+        )
 
 
 isSchengen : Graph.Node Local.Entity -> List Entry -> Bool
-- 
GitLab