Skip to content

Commit

Permalink
Fix permission check
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirFir committed Sep 30, 2024
1 parent 78168ec commit 3c42f56
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,11 @@ class ArticleKeywordFragment : Fragment() {

private fun initKeywordNotification() {
notificationViewModel.getPermissionInfo()
if (requireContext().checkNotificationPermission().not()) {
binding.notificationKeyword.disableAll()
}

binding.notificationKeyword.setOnSwitchClickListener { isChecked ->
if (requireContext().checkNotificationPermission().not()) {
ToastUtil.getInstance().makeShort(R.string.request_notification_permission)
binding.notificationKeyword.isChecked = false
return@setOnSwitchClickListener
}

Expand Down

0 comments on commit 3c42f56

Please sign in to comment.