luci-app-attendedsysupgrade: don't reassign data and firmware info
authorDaniel Nilsson <daniel.nilsson94@outlook.com>
Wed, 28 Feb 2024 22:12:55 +0000 (23:12 +0100)
committerPaul Donald <itsascambutmailmeanyway@gmail.com>
Tue, 19 Mar 2024 16:22:44 +0000 (17:22 +0100)
commitc608a15a9c53a19654f5a36ba2056a7a1eb561da
treef6aaa47d4dc22d6ac77d4322d9109b8c6bbdf6f9
parent374af8b522796424e2b915a4113ed37d22ae653c
luci-app-attendedsysupgrade: don't reassign data and firmware info

The reassignment of the variable that holds the package information once you get a response from the sysupgrade server caused the package list (which is only loaded once when entering the app) to become an array instead of an object (since that's how the response is structured), which gave the result of once cancelling the firmware upgrade, the package list is now an array, making the package list unusable.

This commit updates the variables that shouldn't be changed (data and firmware) to constants and all handle methods to take these values as parameters instead, allowing us to avoid the possible reassignment which will otherwise result in unexpected control flows.

Ref: #6284

Signed-off-by: Daniel Nilsson <daniel.nilsson94@outlook.com>
38 files changed:
applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js
applications/luci-app-attendedsysupgrade/po/ar/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/bg/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/bn_BD/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/ca/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/cs/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/da/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/de/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/el/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/en/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/es/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/fa/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/fi/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/fr/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/he/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/hi/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/hu/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/it/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/ja/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/ko/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/lt/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/mr/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/ms/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/nb_NO/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/nl/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/pl/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/pt/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/pt_BR/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/ro/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/ru/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/sk/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/sv/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/templates/attendedsysupgrade.pot
applications/luci-app-attendedsysupgrade/po/tr/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/uk/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/vi/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/zh_Hans/attendedsysupgrade.po
applications/luci-app-attendedsysupgrade/po/zh_Hant/attendedsysupgrade.po