1
0
Fork 0

For AC #7673 Move DownloadStatus to DownloadState Fenix Side Changes

master
Kate Glazko 2020-07-24 14:43:12 -07:00 committed by Jeff Boek
parent 0e3acfcd94
commit 151e8595b6
1 changed files with 5 additions and 5 deletions

View File

@ -378,8 +378,8 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
downloadFeature.onDownloadStopped = { downloadState, _, downloadJobStatus -> downloadFeature.onDownloadStopped = { downloadState, _, downloadJobStatus ->
// If the download is just paused, don't show any in-app notification // If the download is just paused, don't show any in-app notification
if (downloadJobStatus == AbstractFetchDownloadService.DownloadJobStatus.COMPLETED || if (downloadJobStatus == DownloadState.Status.COMPLETED ||
downloadJobStatus == AbstractFetchDownloadService.DownloadJobStatus.FAILED downloadJobStatus == DownloadState.Status.FAILED
) { ) {
saveDownloadDialogState( saveDownloadDialogState(
@ -391,7 +391,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
val dynamicDownloadDialog = DynamicDownloadDialog( val dynamicDownloadDialog = DynamicDownloadDialog(
container = view.browserLayout, container = view.browserLayout,
downloadState = downloadState, downloadState = downloadState,
didFail = downloadJobStatus == AbstractFetchDownloadService.DownloadJobStatus.FAILED, didFail = downloadJobStatus == DownloadState.Status.FAILED,
tryAgain = downloadFeature::tryAgain, tryAgain = downloadFeature::tryAgain,
onCannotOpenFile = { onCannotOpenFile = {
FenixSnackbar.make( FenixSnackbar.make(
@ -616,12 +616,12 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
private fun saveDownloadDialogState( private fun saveDownloadDialogState(
sessionId: String?, sessionId: String?,
downloadState: DownloadState, downloadState: DownloadState,
downloadJobStatus: AbstractFetchDownloadService.DownloadJobStatus downloadJobStatus: DownloadState.Status
) { ) {
sessionId?.let { id -> sessionId?.let { id ->
sharedViewModel.downloadDialogState[id] = Pair( sharedViewModel.downloadDialogState[id] = Pair(
downloadState, downloadState,
downloadJobStatus == AbstractFetchDownloadService.DownloadJobStatus.FAILED downloadJobStatus == DownloadState.Status.FAILED
) )
} }
} }