Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
fix: Disable UnifiedPush for linkedDevices
Browse files Browse the repository at this point in the history
  • Loading branch information
p1gp1g committed Aug 16, 2024
1 parent 6e25961 commit 914a122
Showing 1 changed file with 19 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,29 +321,28 @@ class NotificationsSettingsFragment : DSLSettingsFragment(R.string.preferences__
}
)

if (!state.isLinkedDevice) {
dividerPref()
dividerPref()

sectionHeaderPref(R.string.NotificationsSettingsFragment__pushStrategy)
sectionHeaderPref(R.string.NotificationsSettingsFragment__pushStrategy)

radioListPref(
title = DSLSettingsText.from(R.string.NotificationsSettingsFragment__deliveryMethod),
listItems = notificationMethodLabels,
selected = notificationMethodValues.indexOf(state.notificationDeliveryMethod),
onSelected = {
viewModel.setNotificationDeliveryMethod(notificationMethodValues[it])
}
)
radioListPref(
title = DSLSettingsText.from(R.string.NotificationsSettingsFragment__deliveryMethod),
listItems = notificationMethodLabels,
selected = notificationMethodValues.indexOf(state.notificationDeliveryMethod),
isEnabled = !state.isLinkedDevice,
onSelected = {
viewModel.setNotificationDeliveryMethod(notificationMethodValues[it])
}
)

clickPref(
title = DSLSettingsText.from(R.string.NotificationsSettingsFragment__unifiedpush),
summary = DSLSettingsText.from(R.string.NotificationsSettingsFragment__unifiedpushDescription),
isEnabled = state.notificationDeliveryMethod == NotificationDeliveryMethod.UNIFIEDPUSH,
onClick = {
findNavController().safeNavigate(R.id.action_notificationsSettingsFragment_to_unifiedPushFragment)
}
)
}
clickPref(
title = DSLSettingsText.from(R.string.NotificationsSettingsFragment__unifiedpush),
summary = DSLSettingsText.from(R.string.NotificationsSettingsFragment__unifiedpushDescription),
isEnabled = state.notificationDeliveryMethod == NotificationDeliveryMethod.UNIFIEDPUSH,
onClick = {
findNavController().safeNavigate(R.id.action_notificationsSettingsFragment_to_unifiedPushFragment)
}
)
}
}

Expand Down

0 comments on commit 914a122

Please sign in to comment.