Commit cf7bf4b4 authored by Eugene Shapovalov's avatar Eugene Shapovalov 💬 Committed by Eugene Shapovalov

Fixed bug associated with reordering events after markdown logic.

parent a978b2ef
...@@ -34,9 +34,8 @@ class IssueNotesPresenter @Inject constructor( ...@@ -34,9 +34,8 @@ class IssueNotesPresenter @Inject constructor(
private fun requestNotes() { private fun requestNotes() {
issueInteractor.getIssueNotes(projectId, issueId) issueInteractor.getIssueNotes(projectId, issueId)
.toObservable() .flattenAsObservable { it }
.flatMapIterable { it } .concatMap { note ->
.flatMap { note ->
mdConverter.markdownToSpannable(note.body) mdConverter.markdownToSpannable(note.body)
.map { NoteWithFormattedBody(note, it) } .map { NoteWithFormattedBody(note, it) }
.toObservable() .toObservable()
......
...@@ -34,9 +34,8 @@ class MergeRequestNotesPresenter @Inject constructor( ...@@ -34,9 +34,8 @@ class MergeRequestNotesPresenter @Inject constructor(
private fun requestNotes() { private fun requestNotes() {
mrInteractor.getMergeRequestNotes(projectId, mrId) mrInteractor.getMergeRequestNotes(projectId, mrId)
.toObservable() .flattenAsObservable { it }
.flatMapIterable { it } .concatMap { note ->
.flatMap { note ->
mdConverter.markdownToSpannable(note.body) mdConverter.markdownToSpannable(note.body)
.map { NoteWithFormattedBody(note, it) } .map { NoteWithFormattedBody(note, it) }
.toObservable() .toObservable()
......
...@@ -6,7 +6,11 @@ import ru.terrakok.gitlabclient.entity.app.target.TargetHeader ...@@ -6,7 +6,11 @@ import ru.terrakok.gitlabclient.entity.app.target.TargetHeader
import ru.terrakok.gitlabclient.extension.openInfo import ru.terrakok.gitlabclient.extension.openInfo
import ru.terrakok.gitlabclient.model.interactor.event.EventInteractor import ru.terrakok.gitlabclient.model.interactor.event.EventInteractor
import ru.terrakok.gitlabclient.model.system.flow.FlowRouter import ru.terrakok.gitlabclient.model.system.flow.FlowRouter
import ru.terrakok.gitlabclient.presentation.global.* import ru.terrakok.gitlabclient.presentation.global.BasePresenter
import ru.terrakok.gitlabclient.presentation.global.ErrorHandler
import ru.terrakok.gitlabclient.presentation.global.GlobalMenuController
import ru.terrakok.gitlabclient.presentation.global.MarkDownConverter
import ru.terrakok.gitlabclient.presentation.global.Paginator
import javax.inject.Inject import javax.inject.Inject
/** /**
...@@ -30,9 +34,8 @@ class MyEventsPresenter @Inject constructor( ...@@ -30,9 +34,8 @@ class MyEventsPresenter @Inject constructor(
private val paginator = Paginator( private val paginator = Paginator(
{ {
eventInteractor.getEvents(it) eventInteractor.getEvents(it)
.toObservable() .flattenAsObservable { it }
.flatMapIterable { it } .concatMap { item ->
.flatMap { item ->
mdConverter.markdownToSpannable(item.body.toString()) mdConverter.markdownToSpannable(item.body.toString())
.map { md -> item.copy(body = md) } .map { md -> item.copy(body = md) }
.toObservable() .toObservable()
......
...@@ -36,9 +36,8 @@ class MyIssuesPresenter @Inject constructor( ...@@ -36,9 +36,8 @@ class MyIssuesPresenter @Inject constructor(
private val paginator = Paginator( private val paginator = Paginator(
{ {
issueInteractor.getMyIssues(filter.createdByMe, filter.onlyOpened, it) issueInteractor.getMyIssues(filter.createdByMe, filter.onlyOpened, it)
.toObservable() .flattenAsObservable { it }
.flatMapIterable { it } .concatMap { item ->
.flatMap { item ->
mdConverter.markdownToSpannable(item.body.toString()) mdConverter.markdownToSpannable(item.body.toString())
.map { md -> item.copy(body = md) } .map { md -> item.copy(body = md) }
.toObservable() .toObservable()
......
...@@ -33,9 +33,8 @@ class MyMergeRequestsPresenter @Inject constructor( ...@@ -33,9 +33,8 @@ class MyMergeRequestsPresenter @Inject constructor(
private val paginator = Paginator( private val paginator = Paginator(
{ {
interactor.getMyMergeRequests(filter.createdByMe, filter.onlyOpened, it) interactor.getMyMergeRequests(filter.createdByMe, filter.onlyOpened, it)
.toObservable() .flattenAsObservable { it }
.flatMapIterable { it } .concatMap { item ->
.flatMap { item ->
mdConverter.markdownToSpannable(item.body.toString()) mdConverter.markdownToSpannable(item.body.toString())
.map { md -> item.copy(body = md) } .map { md -> item.copy(body = md) }
.toObservable() .toObservable()
......
...@@ -37,9 +37,8 @@ class MyTodosPresenter @Inject constructor( ...@@ -37,9 +37,8 @@ class MyTodosPresenter @Inject constructor(
private val paginator = Paginator( private val paginator = Paginator(
{ {
todoListInteractor.getMyTodos(isPending, it) todoListInteractor.getMyTodos(isPending, it)
.toObservable() .flattenAsObservable { it }
.flatMapIterable { it } .concatMap { item ->
.flatMap { item ->
mdConverter.markdownToSpannable(item.body.toString()) mdConverter.markdownToSpannable(item.body.toString())
.map { md -> item.copy(body = md) } .map { md -> item.copy(body = md) }
.toObservable() .toObservable()
......
...@@ -39,9 +39,8 @@ class ProjectIssuesPresenter @Inject constructor( ...@@ -39,9 +39,8 @@ class ProjectIssuesPresenter @Inject constructor(
private val paginator = Paginator( private val paginator = Paginator(
{ {
issueInteractor.getIssues(projectId, issueState, it) issueInteractor.getIssues(projectId, issueState, it)
.toObservable() .flattenAsObservable { it }
.flatMapIterable { it } .concatMap { item ->
.flatMap { item ->
mdConverter.markdownToSpannable(item.body.toString()) mdConverter.markdownToSpannable(item.body.toString())
.map { md -> item.copy(body = md) } .map { md -> item.copy(body = md) }
.toObservable() .toObservable()
......
...@@ -39,9 +39,8 @@ class ProjectMergeRequestsPresenter @Inject constructor( ...@@ -39,9 +39,8 @@ class ProjectMergeRequestsPresenter @Inject constructor(
private val paginator = Paginator( private val paginator = Paginator(
{ {
mergeRequestInteractor.getMergeRequests(projectId, mergeRequestState, it) mergeRequestInteractor.getMergeRequests(projectId, mergeRequestState, it)
.toObservable() .flattenAsObservable { it }
.flatMapIterable { it } .concatMap { item ->
.flatMap { item ->
mdConverter.markdownToSpannable(item.body.toString()) mdConverter.markdownToSpannable(item.body.toString())
.map { md -> item.copy(body = md) } .map { md -> item.copy(body = md) }
.toObservable() .toObservable()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment