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
This commit is contained in:
yparitcher
2022-10-12 17:17:10 -04:00
committed by GitHub
parent da65ac8b02
commit e424fcf5de

View File

@@ -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