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

No differences found