Skip to content

Commit

Permalink
Merge branch 'code-clean-up-for-conditional-statements-droid-541'
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Dec 4, 2023
2 parents 12dc193 + 5ff2638 commit 25788c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ class VoucherDialogViewModel(
when (val result = serviceConnectionManager.voucherRedeemer()?.submit(voucherCode)) {
is VoucherSubmissionResult.Ok -> handleAddedTime(result.submission.timeAdded)
is VoucherSubmissionResult.Error -> setError(result.error)
else -> {
vmState.update { VoucherDialogState.Default }
}
null -> vmState.update { VoucherDialogState.Default }
}
}
}
Expand All @@ -88,7 +86,8 @@ class VoucherDialogViewModel(
when (error) {
VoucherSubmissionError.InvalidVoucher -> R.string.invalid_voucher
VoucherSubmissionError.VoucherAlreadyUsed -> R.string.voucher_already_used
else -> R.string.error_occurred
VoucherSubmissionError.RpcError,
VoucherSubmissionError.OtherError -> R.string.error_occurred
}
)
vmState.update { VoucherDialogState.Error(message) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ class SplitTunnelingPersistence(context: Context) {
}

private fun loadExcludedApps(): Set<String> {
return when {
appListFile.exists() -> appListFile.readLines().toSet()
else -> emptySet()
}
return if (appListFile.exists()) appListFile.readLines().toSet() else emptySet()
}
}

0 comments on commit 25788c6

Please sign in to comment.