Skip to content

Commit 3b5e9d5

Browse files
committed
comma threex -> 3X
1 parent df2c9f1 commit 3b5e9d5

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/utils/device.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
import type { Device } from '~/api/types'
22

3+
function deviceTypePretty(device: Device) {
4+
switch (device.device_type) {
5+
case 'threex':
6+
return 'comma 3X'
7+
case 'neo':
8+
return 'EON'
9+
case 'freon':
10+
return 'freon'
11+
case 'unknown':
12+
return 'unknown'
13+
default:
14+
return `comma ${device.device_type}`
15+
}
16+
}
17+
318
export function getDeviceName(device: Device) {
419
if (device.alias) return device.alias
5-
return `comma ${device.device_type}`
20+
return deviceTypePretty(device)
621
}

0 commit comments

Comments
 (0)