Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
fixed always show tags
Browse files Browse the repository at this point in the history
  • Loading branch information
seldon1000 committed Jul 29, 2021
1 parent 5941814 commit 4fcf9a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/src/main/java/eu/seldon1000/nextpass/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class MainActivity : FragmentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

viewModel = ViewModelProvider(this).get(MainViewModel(application = application)::class.java)
viewModel =
ViewModelProvider(this).get(MainViewModel(application = application)::class.java)

autofillSettingsResult =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/eu/seldon1000/nextpass/MainViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,12 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
fun enableTags(refresh: Boolean = true) {
if (refresh) executeRequest { nextcloudApi.refreshServerList() }

sharedPreferences.edit().putBoolean("tags", true).apply()
sharedPreferences.edit().remove("tags").apply()
tags.value = true
}

fun disableTags() {
sharedPreferences.edit().remove("tags").apply()
sharedPreferences.edit().putBoolean("tags", true).apply()
tags.value = false
}

Expand Down

0 comments on commit 4fcf9a9

Please sign in to comment.