Clean up PDFViewerActivity for consistency

This commit is contained in:
Ensar Sarajčić 2023-07-07 08:06:50 +02:00
parent 4d0a7121cc
commit 85559abbf4
1 changed files with 7 additions and 3 deletions

View File

@ -110,15 +110,19 @@ class PDFViewerActivity : SimpleActivity() {
.onTap { toggleFullScreen() } .onTap { toggleFullScreen() }
.onError { .onError {
if (it is PdfPasswordException) { if (it is PdfPasswordException) {
// Already entered a password and it was wrong // already entered a password and it was wrong
if (filePassword != null) { if (filePassword != null) {
showErrorToast(getString(R.string.invalid_password)) showErrorToast(getString(R.string.invalid_password))
finish() finish()
} else { } else {
EnterPasswordDialog( EnterPasswordDialog(
this, this,
callback = { password -> loadPdfViewer(uri, password) }, callback = { password ->
cancelCallback = { finish() } loadPdfViewer(uri, password)
},
cancelCallback = {
finish()
}
) )
} }
} else { } else {