mitchtabian/Open-API-Android-App

duplicate dialog

razaghimahdi opened this issue · 1 comments

so sometimes i get duplicate dialog, i got logging and it seems queue list returns duplicate in observers, why is that? how should i to resolve that?

Boys and Girls, remember that if we use this way to change value of state:

val update = getCurrentViewStateOrNew()
                update.queue = queue
                setViewState(update)

it will make things duplicate, for example i have an Event which inside that was another Event so when dialog pop up it would be 3 or 2 time duplicate,
so use this way as mitch already said:

this.state.value = state.copy(queue = queue)