"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleDeviceInfoRequests = handleDeviceInfoRequests;
const deviceInfoCommands_1 = require("./deviceInfoCommands");
function handleDeviceInfoRequests(onCommand, dispatch, frontApplet) {
    onCommand(async (commandEvent) => {
        switch (commandEvent.command.type) {
            case deviceInfoCommands_1.DeviceInfoGetLocationRequest:
                await dispatch({
                    type: deviceInfoCommands_1.DeviceInfoGetLocationResult,
                    result: await frontApplet.deviceInfo.getLocation(),
                });
                break;
            case deviceInfoCommands_1.DeviceInfoGetOrganizationTagsRequest:
                await dispatch({
                    type: deviceInfoCommands_1.DeviceInfoGetOrganizationTagsResult,
                    result: await frontApplet.deviceInfo.getOrganizationTags(),
                });
                break;
            case deviceInfoCommands_1.DeviceInfoGetDeviceNameRequest:
                await dispatch({
                    type: deviceInfoCommands_1.DeviceInfoGetDeviceNameResult,
                    result: await frontApplet.deviceInfo.getDeviceName(),
                });
                break;
            default:
        }
    });
}
//# sourceMappingURL=handleDeviceInfoRequests.js.map