"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleManagementAutoRecoveryRequests = handleManagementAutoRecoveryRequests;
const autoRecoveryCommands_1 = require("./autoRecoveryCommands");
function handleManagementAutoRecoveryRequests(onCommand, dispatch, frontApplet) {
    onCommand(async (commandEvent) => {
        switch (commandEvent.command.type) {
            case autoRecoveryCommands_1.ManagementAutoRecoveryGetRequest:
                await dispatch({
                    type: autoRecoveryCommands_1.ManagementAutoRecoveryGetResult,
                    result: await frontApplet.management.autoRecovery.get(),
                });
                break;
            case autoRecoveryCommands_1.ManagementAutoRecoverySetRequest:
                await frontApplet.management.autoRecovery.set(commandEvent.command.configuration);
                await dispatch({
                    type: autoRecoveryCommands_1.ManagementAutoRecoverySetResult,
                    result: {},
                });
                break;
            default:
        }
    });
}
//# sourceMappingURL=handleAutoRecoveryRequests.js.map