mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 17:23:25 +00:00
ADD - implement CrewLink location groups
This commit is contained in:
@@ -185,6 +185,16 @@ type BillingNotificationData = {
|
||||
text?: string
|
||||
title?: string
|
||||
}
|
||||
|
||||
type CrewLinkNotificationData = {
|
||||
actor?: string
|
||||
device?: PhoneNotificationDevicePayload
|
||||
groupName?: string
|
||||
kind?: 'invite' | 'member_joined' | 'ping' | 'role' | 'removed'
|
||||
pingLabel?: string
|
||||
text?: string
|
||||
title?: string
|
||||
}
|
||||
const REFERENCE_VIEWPORT_WIDTH = 1920
|
||||
const REFERENCE_VIEWPORT_HEIGHT = 1080
|
||||
const PHONE_BASE_SCALE = 0.69
|
||||
@@ -656,6 +666,28 @@ function onMessage(event: MessageEvent<AppMessage>): void {
|
||||
}
|
||||
}
|
||||
notifications.show(notification)
|
||||
} else if (
|
||||
event.data?.type === 'crewlink:notification' &&
|
||||
event.data.data
|
||||
) {
|
||||
const data = event.data.data as CrewLinkNotificationData
|
||||
const notification: PhoneNotificationInput = {
|
||||
appId: 'crewlink',
|
||||
subtitle: data.groupName,
|
||||
text: data.text ?? phone.t('Apps.crewlink.notifications.default'),
|
||||
title: data.title ?? phone.t('Apps.crewlink.name'),
|
||||
}
|
||||
if (
|
||||
data.device &&
|
||||
(!phone.isOpen || data.device.imei !== phone.device?.imei)
|
||||
) {
|
||||
notification.device = {
|
||||
imei: data.device.imei,
|
||||
name: data.device.name,
|
||||
preferences: parsePhonePreferences(data.device.settings ?? null),
|
||||
}
|
||||
}
|
||||
notifications.show(notification)
|
||||
} else if (
|
||||
(event.data?.type === 'call:incoming' ||
|
||||
event.data?.type === 'call:state') &&
|
||||
|
||||
Reference in New Issue
Block a user