Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: app crash on going back from similar fragment' #1489

Merged
merged 1 commit into from
Mar 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import org.fossasia.openevent.general.event.EventUtils
import org.fossasia.openevent.general.event.EventsListAdapter
import org.fossasia.openevent.general.common.FavoriteFabClickListener
import org.fossasia.openevent.general.common.ShareFabClickListener
import org.fossasia.openevent.general.event.EventLayoutType
import org.fossasia.openevent.general.utils.Utils.getAnimSlide
import org.fossasia.openevent.general.utils.extensions.nonNull
import org.koin.android.ext.android.get
Expand Down Expand Up @@ -97,7 +98,7 @@ class SimilarEventsFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

similarEventsListAdapter = get(scope = getOrCreateScope(Scopes.SIMILAR_EVENTS_FRAGMENT.toString()))
similarEventsListAdapter = EventsListAdapter(EventLayoutType.SIMILAR_EVENTS, get())

val eventClickListener: EventClickListener = object : EventClickListener {
override fun onClick(eventID: Long) {
Expand Down Expand Up @@ -170,7 +171,6 @@ class SimilarEventsFragment : Fragment() {

handleVisibility(similarEvents)
Timber.d("Fetched Similar events of size %s", similarEvents.size)
similarEvents.shuffle()
similarEventsListAdapter.submitList(similarEvents)
similarEventsListAdapter.notifyDataSetChanged()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class SimilarEventsViewModel(private val eventService: EventService) : ViewModel
}.subscribe({
mutableSimilarLocationEvents.value = it.filter { it.id != eventId }
}, {
Timber.e(it, "Error fetching simialr events")
Timber.e(it, "Error fetching similar events")
mutableError.value = "Error fetching similar events"
})
)
Expand Down