diff --git a/src/devices/ArchivedDevice.tsx b/src/devices/ArchivedDevice.tsx index 4da9a2efa..474ab0909 100644 --- a/src/devices/ArchivedDevice.tsx +++ b/src/devices/ArchivedDevice.tsx @@ -7,8 +7,17 @@ import BaseDevice from './BaseDevice'; import {DeviceType, OS, DeviceShell, DeviceLogEntry} from './BaseDevice'; +function normalizeArchivedDeviceType(deviceType: DeviceType): DeviceType { + let archivedDeviceType = deviceType; + if (archivedDeviceType === 'emulator') { + archivedDeviceType = 'archivedEmulator'; + } else if (archivedDeviceType === 'physical') { + archivedDeviceType = 'archivedPhysical'; + } + return archivedDeviceType; +} + export default class ArchivedDevice extends BaseDevice { - // @ts-ignore: Super needs to be on the first line constructor( serial: string, deviceType: DeviceType, @@ -16,13 +25,7 @@ export default class ArchivedDevice extends BaseDevice { os: OS, logEntries: Array, ) { - let archivedDeviceType = deviceType; - if (archivedDeviceType === 'emulator') { - archivedDeviceType = 'archivedEmulator'; - } else if (archivedDeviceType === 'physical') { - archivedDeviceType = 'archivedPhysical'; - } - super(serial, archivedDeviceType, title, os); + super(serial, normalizeArchivedDeviceType(deviceType), title, os); this.logs = logEntries; }