Fix race condition when AuthActivity finished and resumes BrowseFiles

Callback method is executed before races against onStart of the Fragment so the fix of d93624c5dd93bdbb947d645187c1a5b0fed34c1b doesn't always help.
This commit is contained in:
Julian Raufelder 2022-02-04 18:57:31 +01:00
parent f10ac8798a
commit 00bc4e4e35
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D

View File

@ -232,7 +232,6 @@ class BrowseFilesPresenter @Inject constructor( //
@Callback(dispatchResultOkOnly = false)
fun getCloudListAfterAuthentication(result: ActivityResult, cloudFolderModel: CloudFolderModel) {
resumedAfterAuthentication = false
if(result.isResultOk) {
val cloudModel = result.getSingleResult(CloudModel::class.java) // FIXME update other vaults using this cloud as well
val cloudNode = cloudFolderModel.toCloudNode()
@ -251,6 +250,7 @@ class BrowseFilesPresenter @Inject constructor( //
val folder = cloudFolderModelMapper.toModel(it)
view?.updateActiveFolderDueToAuthenticationProblem(folder)
getCloudList(folder)
resumedAfterAuthentication = false
} ?: throw FatalBackendException("cloudFolderModel with updated Cloud shouldn't be null")
}
@ -263,6 +263,9 @@ class BrowseFilesPresenter @Inject constructor( //
view?.updateActiveFolderDueToAuthenticationProblem(folder)
getCloudList(folder)
}
override fun onFinished() {
resumedAfterAuthentication = false
}
})
}