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

Prevent multiple regist to eventHub on same TimelineFlagment #879

Merged
merged 1 commit into from Oct 15, 2018

Conversation

Projects
None yet
4 participants
@kyori19
Copy link
Contributor

kyori19 commented Oct 8, 2018

eventHub.getEvents()
.observeOn(AndroidSchedulers.mainThread())
.as(autoDisposable(from(this, Lifecycle.Event.ON_DESTROY)))
.subscribe(event -> {

onActivityCreated is called every time when switching tabs.
Since subscribe is called every time when switching tab, it gets timeline unnecessarily many times after toot.

@connyduck

This comment has been minimized.

Copy link
Member

connyduck commented Oct 8, 2018

Indeed it does, nice find. I just wonder if there isnt a better solution to this, like moving the subscribtion to onCreate?

@charlag

This comment has been minimized.

Copy link
Collaborator

charlag commented Oct 8, 2018

Hi!
Thanks for the help, we could really miss that (these fragment lifecycles, oh.
I would prefer to move it to something which is executed only once but that's probably nowhere to be found, I think.

I'll try it out later this week

@charlag

This comment has been minimized.

Copy link
Collaborator

charlag commented Oct 8, 2018

@connyduck it is risky because we may need UI, we should check that manually

@kyori19

This comment has been minimized.

Copy link
Contributor Author

kyori19 commented Oct 8, 2018

Thanks for your reply.
@connyduck I already tried to move to onCreate but app crashed because we need UI.

@Tak

This comment has been minimized.

Copy link
Contributor

Tak commented Oct 15, 2018

Aha, I bet this addresses #880

@connyduck connyduck merged commit 1556a88 into tuskyapp:master Oct 15, 2018

3 checks passed

ci/bitrise/a3e773c3c57a894c/pr Passed - Tusky
Details
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details

@kyori19 kyori19 deleted the accelforce:fix-timeline-event branch Oct 15, 2018

@charlag charlag referenced this pull request Dec 13, 2018

Closed

Reply is sometimes shown twice in the thread view #880

1 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment