Skip to content

Commit

Permalink
Show notification on error
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Jul 29, 2019
1 parent 85f5ff3 commit 0e9b71e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ abstract class RemoteFileService : NotificationService() {
.doOnSubscribe { update(subject.hashCode()) { it.setContentTitle(subject.title) } }
.subscribeK(onError = {
Timber.e(it)
remove(subject.hashCode())
finishNotify(subject.hashCode()) { notification ->
notification.setContentText(getString(R.string.download_file_error))
.setSmallIcon(android.R.drawable.stat_notify_error)
.setOngoing(false)
}
}) {
val newId = finishNotify(it, subject)
get<Activity?>()?.run {
Expand Down

0 comments on commit 0e9b71e

Please sign in to comment.