Fix state mismanagement

This commit is contained in:
Gabriel Tofvesson 2024-10-12 23:07:05 +02:00
parent 27f87b4bae
commit 70c55a42f0

View File

@ -582,7 +582,7 @@ local PAGES = {
-- Set dynamic states for elements
sortButton:setText("<"..tostring(state.sortMode)..">")
sortButton:setText("<"..tostring(pageState.sortMode)..">")
storageSatProgress:setProgress(1 - (emptyCount / totalCount))
local basePageIndex = (pageState.currentPage - 1) * groupEntryListBudget
@ -669,7 +669,7 @@ local PAGES = {
keyboardButton:setOnClick(function()
print("Toggling keyboard...")
state.showKeyboard = not state.showKeyboard
pageState.showKeyboard = not pageState.showKeyboard
reloadState()
return true
@ -693,7 +693,7 @@ local PAGES = {
sortButton:setOnClick(function()
print("Reorganizing...")
state.sortMode = (state.sortMode + 1 + #SORT_MODE) % #SORT_MODE
pageState.sortMode = (pageState.sortMode + 1 + #SORT_MODE) % #SORT_MODE
reloadState()
return true
end)