"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleMonitoringRequests = handleMonitoringRequests;
const monitoringCommands_1 = require("./monitoringCommands");
function handleMonitoringRequests(onCommand, dispatch, frontApplet) {
    onCommand(async (commandEvent) => {
        switch (commandEvent.command.type) {
            case monitoringCommands_1.EnableMonitoring:
                frontApplet.config.sosMonitoring = true;
                break;
            case monitoringCommands_1.DisableMonitoring:
                frontApplet.config.sosMonitoring = false;
                break;
            case monitoringCommands_1.AppletRefreshRequest:
                await frontApplet.refresh();
                await dispatch({
                    type: monitoringCommands_1.AppletRefreshResult,
                    result: {},
                });
                break;
            case monitoringCommands_1.AppletRestoreRequest:
                await dispatch({
                    type: monitoringCommands_1.AppletRestoreResult,
                    result: {},
                });
                frontApplet.restore();
                break;
            default:
        }
    });
}
//# sourceMappingURL=handleMonitoringRequests.js.map