From 82e0044ba033c81cd47c29eab2086ac69572e280 Mon Sep 17 00:00:00 2001
From: Gabriel Tofvesson <gabriel@tofvesson.se>
Date: Sat, 12 Oct 2024 04:46:43 +0200
Subject: [PATCH] Invalidate root on GUI update

---
 itemcontroller.lua | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/itemcontroller.lua b/itemcontroller.lua
index e0007c5..09beb44 100644
--- a/itemcontroller.lua
+++ b/itemcontroller.lua
@@ -539,6 +539,18 @@ local PAGES = {
       }
     }
 
+    local stuffContainer = List:new{
+      [Orientation:getId()] = Orientation.VERTICAL,
+      [Children:getId()] = {
+        paddedTitle,
+        paddedRequestCount
+      },
+      onClick = function(e, x, y, s)
+        state:setPage("GROUP_DETAIL", group)
+        return true
+      end
+    }
+
     local function updateDisplayState()
       local dataRequestText = paddedRequestCount:findById("data_request")
       local dataDividerPad = paddedRequestCount:findById("data_divider")
@@ -552,6 +564,8 @@ local PAGES = {
       }
       dataAvailableText:setText(tostring(group:getItemCount()))
       requestCapProgress:setProgress(pageState.request / group:getItemCount())
+
+      stuffContainer:setDirty(true)
     end
 
     local function bindRequestButton(increment)
@@ -571,18 +585,6 @@ local PAGES = {
     bindRequestButton(1)
     bindRequestButton(5)
 
-    local stuffContainer = List:new{
-      [Orientation:getId()] = Orientation.VERTICAL,
-      [Children:getId()] = {
-        paddedTitle,
-        paddedRequestCount
-      },
-      onClick = function(e, x, y, s)
-        state:setPage("GROUP_DETAIL", group)
-        return true
-      end
-    }
-
     return renderDefault(state, stuffContainer)
   end
 }