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(
private fun requestNotes() {
issueInteractor.getIssueNotes(projectId, issueId)
.toObservable()
.flatMapIterable { it }
.flatMap { note ->
.flattenAsObservable { it }
.concatMap { note ->
mdConverter.markdownToSpannable(note.body)
.map { NoteWithFormattedBody(note, it) }
.toObservable()
......
......@@ -34,9 +34,8 @@ class MergeRequestNotesPresenter @Inject constructor(
private fun requestNotes() {
mrInteractor.getMergeRequestNotes(projectId, mrId)
.toObservable()
.flatMapIterable { it }
.flatMap { note ->
.flattenAsObservable { it }
.concatMap { note ->
mdConverter.markdownToSpannable(note.body)
.map { NoteWithFormattedBody(note, it) }
.toObservable()
......
......@@ -6,7 +6,11 @@ import ru.terrakok.gitlabclient.entity.app.target.TargetHeader
import ru.terrakok.gitlabclient.extension.openInfo
import ru.terrakok.gitlabclient.model.interactor.event.EventInteractor
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
/**
......@@ -30,9 +34,8 @@ class MyEventsPresenter @Inject constructor(
private val paginator = Paginator(
{
eventInteractor.getEvents(it)
.toObservable()
.flatMapIterable { it }
.flatMap { item ->
.flattenAsObservable { it }
.concatMap { item ->
mdConverter.markdownToSpannable(item.body.toString())
.map { md -> item.copy(body = md) }
.toObservable()
......
......@@ -36,9 +36,8 @@ class MyIssuesPresenter @Inject constructor(
private val paginator = Paginator(
{
issueInteractor.getMyIssues(filter.createdByMe, filter.onlyOpened, it)
.toObservable()
.flatMapIterable { it }
.flatMap { item ->
.flattenAsObservable { it }
.concatMap { item ->
mdConverter.markdownToSpannable(item.body.toString())
.map { md -> item.copy(body = md) }
.toObservable()
......
......@@ -33,9 +33,8 @@ class MyMergeRequestsPresenter @Inject constructor(
private val paginator = Paginator(
{
interactor.getMyMergeRequests(filter.createdByMe, filter.onlyOpened, it)
.toObservable()
.flatMapIterable { it }
.flatMap { item ->
.flattenAsObservable { it }
.concatMap { item ->
mdConverter.markdownToSpannable(item.body.toString())
.map { md -> item.copy(body = md) }
.toObservable()
......
......@@ -37,9 +37,8 @@ class MyTodosPresenter @Inject constructor(
private val paginator = Paginator(
{
todoListInteractor.getMyTodos(isPending, it)
.toObservable()
.flatMapIterable { it }
.flatMap { item ->
.flattenAsObservable { it }
.concatMap { item ->
mdConverter.markdownToSpannable(item.body.toString())
.map { md -> item.copy(body = md) }
.toObservable()
......
......@@ -39,9 +39,8 @@ class ProjectIssuesPresenter @Inject constructor(
private val paginator = Paginator(
{
issueInteractor.getIssues(projectId, issueState, it)
.toObservable()
.flatMapIterable { it }
.flatMap { item ->
.flattenAsObservable { it }
.concatMap { item ->
mdConverter.markdownToSpannable(item.body.toString())
.map { md -> item.copy(body = md) }
.toObservable()
......
......@@ -39,9 +39,8 @@ class ProjectMergeRequestsPresenter @Inject constructor(
private val paginator = Paginator(
{
mergeRequestInteractor.getMergeRequests(projectId, mergeRequestState, it)
.toObservable()
.flatMapIterable { it }
.flatMap { item ->
.flattenAsObservable { it }
.concatMap { item ->
mdConverter.markdownToSpannable(item.body.toString())
.map { md -> item.copy(body = md) }
.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