Add overlay permission to update device status action

This commit is contained in:
Jonas L
2019-03-25 00:00:00 +00:00
parent b591a07cf5
commit 1270d74a70
3 changed files with 32 additions and 2 deletions
@@ -91,6 +91,22 @@ export async function dispatchUpdateDeviceStatus ({ deviceId, action, cache }: {
}
}
if (action.newOverlayPermission) {
const hasChanged = deviceEntry.currentOverlayPermission !== action.newOverlayPermission
deviceEntry.currentOverlayPermission = action.newOverlayPermission
deviceEntry.highestOverlayPermission = enumMax(
deviceEntry.currentOverlayPermission,
deviceEntry.highestOverlayPermission,
runtimePermissionStatusValues
)
if (hasChanged && (deviceEntry.currentOverlayPermission !== deviceEntry.highestOverlayPermission)) {
deviceEntry.hadManipulation = true
}
}
if (action.newAppVersion !== undefined) {
const hasChanged = deviceEntry.currentAppVersion !== action.newAppVersion