UserPreference: delete all shortcuts when repository is deleted (#850)

This commit is contained in:
Harsh Shandilya 2020-06-14 07:54:46 +00:00 committed by GitHub
parent 5aab4088d1
commit cd72d15b32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- 'Draw over other apps' permission dialog opens when attempting to use Oreo Autofill
- Old app shortcuts are now removed when the local repository is deleted
### Added
- Completely revamped decypted password view

View file

@ -232,6 +232,11 @@ class UserPreference : AppCompatActivity() {
// TODO Handle the different cases of exceptions
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
requireContext().getSystemService<ShortcutManager>()?.apply {
removeDynamicShortcuts(dynamicShortcuts.map { it.id }.toMutableList())
}
}
sharedPreferences.edit { putBoolean("repository_initialized", false) }
dialogInterface.cancel()
callingActivity.finish()