Skip to content

Commit

Permalink
fix: set the correct account for automatic uploads when there are use…
Browse files Browse the repository at this point in the history
…rs light
  • Loading branch information
joragua committed Dec 3, 2024
1 parent 1c13299 commit 31646a7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,15 @@ class SettingsPictureUploadsFragment : PreferenceFragmentCompat() {
enablePictureUploads(false, true)
showMessageInSnackbar(getString(R.string.prefs_automatic_uploads_not_available_users_light))
} else {
selectedAccount = availableAccounts.first().accountName
val currentAccount = manageAccountsViewModel.getCurrentAccount()?.name
currentAccount?.let {
selectedAccount = if (manageAccountsViewModel.checkUserLight(currentAccount)) {
availableAccounts.first().accountName
} else {
currentAccount
}
}

picturesViewModel.pictureUploads.collect { pictureUploadsConfiguration ->
enablePictureUploads(pictureUploadsConfiguration != null, false)
pictureUploadsConfiguration?.let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,15 @@ class SettingsVideoUploadsFragment : PreferenceFragmentCompat() {
enableVideoUploads(false, true)
showMessageInSnackbar(getString(R.string.prefs_automatic_uploads_not_available_users_light))
} else {
selectedAccount = availableAccounts.first().accountName
val currentAccount = manageAccountsViewModel.getCurrentAccount()?.name
currentAccount?.let {
selectedAccount = if (manageAccountsViewModel.checkUserLight(currentAccount)) {
availableAccounts.first().accountName
} else {
currentAccount
}
}

videosViewModel.videoUploads.collect { videoUploadsConfiguration ->
enableVideoUploads(videoUploadsConfiguration != null, false)
videoUploadsConfiguration?.let {
Expand Down

0 comments on commit 31646a7

Please sign in to comment.