Skip to content

Commit

Permalink
Merge branch 'develop' into issue/682-fix-window-leaked-crash
Browse files Browse the repository at this point in the history
# Conflicts:
#	stories/src/main/java/com/wordpress/stories/compose/ComposeLoopFrameActivity.kt
  • Loading branch information
aforcier committed May 13, 2021
2 parents 2323287 + 032e7a4 commit 21f7ddb
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -624,11 +624,9 @@ abstract class ComposeLoopFrameActivity : AppCompatActivity(), OnStoryFrameSelec
})
}

private fun deleteCaptureMediaAndFinishWhenEmptyStory() {
private fun finishWhenEmptyStory() {
if (storyViewModel.getCurrentStorySize() == 0 &&
firstIntentLoaded && !permissionsRequestForCameraInProgress) {
// finally, delete the captured media
deleteCapturedMedia()
finish()
}
}
Expand Down Expand Up @@ -885,7 +883,7 @@ abstract class ComposeLoopFrameActivity : AppCompatActivity(), OnStoryFrameSelec
} else if (intent.hasExtra(requestCodes.EXTRA_LAUNCH_WPSTORIES_MEDIA_PICKER_REQUESTED)) {
// if coming from the PHOTO_PICKER with a cancel action, and we launched with
// EXTRA_LAUNCH_WPSTORIES_MEDIA_PICKER_REQUESTED to start the Story with, we should cancel.
deleteCaptureMediaAndFinishWhenEmptyStory()
finishWhenEmptyStory()
}
}
}
Expand Down Expand Up @@ -1089,6 +1087,8 @@ abstract class ComposeLoopFrameActivity : AppCompatActivity(), OnStoryFrameSelec
listener = object : FrameSaveErrorDialogOk {
override fun OnOkClicked(dialog: DialogFragment) {
dialog.dismiss()
// first of all, delete the backing captured media for this slide
deleteCapturedMedia()
if (storyViewModel.getCurrentStorySize() == 1) {
// discard the whole story
safelyDiscardCurrentStoryAndCleanUpIntent()
Expand Down

0 comments on commit 21f7ddb

Please sign in to comment.