UNPKG

@ledgerhq/live-common

Version:
26 lines 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.filterIgnoredFirmwareUpdates = void 0; /** * Filters out ignored firmware updates from the action state * * @param newValue The current action state * @param ignoredOSUpdates Array of firmware versions to ignore * @returns The filtered action state */ const filterIgnoredFirmwareUpdates = (newValue, ignoredOSUpdates) => { // There is an available firmware update if (newValue.status === "available-firmware" && newValue.firmwareUpdateContext?.final.name) { // Filter out the ignored firmware versions if (ignoredOSUpdates && ignoredOSUpdates.includes(newValue.firmwareUpdateContext?.final.name)) { return { ...newValue, firmwareUpdateContext: null, status: "no-available-firmware", }; } } return newValue; }; exports.filterIgnoredFirmwareUpdates = filterIgnoredFirmwareUpdates; //# sourceMappingURL=filterIgnoredFirmwareUpdates.js.map