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 reload feed button does nothing #5430

Merged
merged 2 commits into from
Jan 18, 2021
Merged

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Jan 16, 2021

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

This was caused by view binding PR. initListeners was being called before the bindings were assigned, and therefore the click listener was never setup. @Isira-Seneviratne

Due diligence

@XiangRongLin XiangRongLin added the bug Issue is related to a bug label Jan 17, 2021
@Stypox
Copy link
Member Author

Stypox commented Jan 18, 2021

@XiangRongLin could you review this? :-)

Copy link
Collaborator

@XiangRongLin XiangRongLin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initListeners was being called before the bindings were assigned, and therefore the click listener was never setup

Add that reasoning to the commit message

@XiangRongLin
Copy link
Collaborator

XiangRongLin commented Jan 18, 2021

Unrelated, but is it intended that it's possible for _feedbinding to be null while accessing it? For example here

listState = _feedBinding?.itemsList?.layoutManager?.onSaveInstanceState()

If not, all usages of _feedbinding should be replaced with feedbinding, to not silently break features, but breaking them visibly


Also since you are already there, to me it looks like _errorBinding does not need that weird setup. It can just be a lateinit var. Because unlike _feedbinding it's not set to null in onDestroyView

@Stypox
Copy link
Member Author

Stypox commented Jan 18, 2021

Also since you are already there, to me it looks like _errorBinding does not need that weird setup. It can just be a lateinit var. Because unlike _feedbinding it's not set to null in onDestroyView

_errorBinding will be removed completely in #5148, so I'm not taking care of it here (though I was tempted to ;-)) I did it anyway

If not, all usages of _feedbinding should be replaced with feedbinding, to not silently break features, but breaking them visibly

I agree, I'm going to remove them

@Stypox
Copy link
Member Author

Stypox commented Jan 18, 2021

Done @XiangRongLin

initListeners was being called before the bindings were assigned, and therefore the click listener was never setup
@XiangRongLin XiangRongLin merged commit 5814743 into TeamNewPipe:dev Jan 18, 2021
This was referenced Jan 18, 2021
tossj pushed a commit to tossj/NewPipe-legacy that referenced this pull request Apr 21, 2021
@Stypox Stypox deleted the fix-feed branch August 4, 2022 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants