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

feat: remove visibilityjs #10870

Merged
merged 6 commits into from
Aug 30, 2022
Merged

Conversation

oplik0
Copy link
Contributor

@oplik0 oplik0 commented Aug 29, 2022

Removes a now unnecessary dependency.

Instead app.isFocused is just a getter returning true if document.visibilityState is equal to visible. This also means one NodeBB is listening on one less event :)

@nodebb-misty
Copy link
Contributor

💡 Friendly Note

This pull request was made against the develop branch, which is reserved for commits destined for a minor or major release.If your commits simply fixes a bug, please rebase this PR against the master instead.

  • patch releases — bug fixes only
  • minor releases — new features, enhancements, and bug fixes
  • major releases — breaking changes, including all of the above

Thanks!

@barisusakli
Copy link
Member

LGTM

Comment on lines -22 to +25
app.isFocused = true;
Object.defineProperty(app, 'isFocused', {
get() {
return document.visibilityState === 'visible';
}
});
Copy link
Member

Choose a reason for hiding this comment

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

This is cool. TIL.

@julianlam julianlam merged commit 1920732 into NodeBB:develop Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants