Skip to content

Commit

Permalink
Remove restore protections when protection have been restored (#5049)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/488551667048375/1208280638257502/f

### Description
On the VPN exclusion list screen:
- Show context menu > Restore defaults IF there is something to restore
- ELSE, hide it

### Steps to test this PR

- [ ] Open VPN screen
- [ ] Open Excluded apps
- [ ] Click on context menu
- [ ] Confirm that "Restore Protection for All Apps" is NOT shown
- [ ] Exclude one app
- [ ] Confirm that "Restore Protection for All Apps" is shown
  • Loading branch information
karlenDimla authored Sep 23, 2024
1 parent 121bc4f commit 8ad20e6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class NetpAppExclusionListActivity :
override fun onPrepareOptionsMenu(menu: Menu): Boolean {
val restoreDefault = menu.findItem(R.id.netp_exclusion_menu_restore)
// onPrepareOptionsMenu is called when overflow menu is being displayed, that's why this can be an imperative call
restoreDefault?.isEnabled = viewModel.canRestoreDefaults()
restoreDefault?.setVisible(viewModel.canRestoreDefaults())

return super.onPrepareOptionsMenu(menu)
}
Expand Down

0 comments on commit 8ad20e6

Please sign in to comment.