Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
android:exported="false" />
<activity
android:name=".upload.UploadProgressActivity"
android:configChanges="orientation|screenSize|keyboard|smallestScreenSize|screenLayout"
android:exported="false" />
<activity
android:name=".description.DescriptionEditActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ class PendingUploadsFragment :
* Cancels a specific upload after getting a confirmation from the user using Dialog.
*/
override fun deleteUpload(contribution: Contribution?) {
if (!::pendingUploadsPresenter.isInitialized) return // defensive Check

val activity = requireActivity()
val locale = Locale.getDefault()
showAlertDialog(
Expand All @@ -140,19 +142,29 @@ class PendingUploadsFragment :
/**
* Restarts all the paused uploads.
*/
fun restartUploads() = pendingUploadsPresenter.restartUploads(
contributionsList, 0, requireContext().applicationContext
)
fun restartUploads() {
if (::pendingUploadsPresenter.isInitialized) {
pendingUploadsPresenter.restartUploads(
contributionsList, 0, requireContext().applicationContext
)
}
}

/**
* Pauses all the ongoing uploads.
*/
fun pauseUploads() = pendingUploadsPresenter.pauseUploads()
fun pauseUploads() {
if (::pendingUploadsPresenter.isInitialized) {
pendingUploadsPresenter.pauseUploads()
}
}

/**
* Cancels all the uploads after getting a confirmation from the user using Dialog.
*/
fun deleteUploads() {
if (!::pendingUploadsPresenter.isInitialized) return

val activity = requireActivity()
val locale = Locale.getDefault()
showAlertDialog(
Expand Down