From e424fcf5de135dbf64f82fc667792197151c5ffc Mon Sep 17 00:00:00 2001 From: yparitcher Date: Wed, 12 Oct 2022 17:17:10 -0400 Subject: [PATCH] Dispatcher: Fix subtle bug with modified items being added twice to the sort index (#9628) Discovered by @poire-z in https://github.com/koreader/koreader/pull/9531#issuecomment-1274839234 --- frontend/dispatcher.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/dispatcher.lua b/frontend/dispatcher.lua index dc05ab25e..15f4a64a8 100644 --- a/frontend/dispatcher.lua +++ b/frontend/dispatcher.lua @@ -518,7 +518,9 @@ function Dispatcher:_addToOrder(location, settings, item) end end else - table.insert(location[settings].settings.order, item) + if not util.arrayContains(location[settings].settings.order, item) then + table.insert(location[settings].settings.order, item) + end end end end