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

Reformatting and Refactoring #5138

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

SamuelCasellas
Copy link

This is my first open source contribution. I thought I would start simple with some basic formatting and refactoring. Thank you.

@SamuelCasellas SamuelCasellas requested a review from a team as a code owner January 6, 2025 12:33
@SamuelCasellas SamuelCasellas requested review from unixfox and removed request for a team January 6, 2025 12:33
@unixfox
Copy link
Member

unixfox commented Jan 6, 2025

hey @AHOHNMYC @ChunkyProgrammer, could you please take a look at this PR? You have more JS experience than me :). thanks

Copy link
Contributor

@ChunkyProgrammer ChunkyProgrammer left a comment

Choose a reason for hiding this comment

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

Changes looks good. I just have one comment 🙂

if (matchedCookie) {
const cookieBody = matchedCookie.replace(cookiePrefix, '');
if (cookieBody.length === 0) return;
if (!cookieBody.length) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

cookieBody.length === 0 is better for readability so I'd recommend keeping that. If we want to use less bytes for this type of statement, i think a minifier should be used instead.

Copy link
Author

Choose a reason for hiding this comment

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

Good call. We can minify later as desired.

@SamuelCasellas SamuelCasellas changed the title Basic reformatting "Could not fetch comments" Message Jan 10, 2025
@SamuelCasellas
Copy link
Author

Added addition for displaying a message at the comments section if comments for the video were turned off. The current behavior does not display anything if comments don't load, which can be confusing.

@SamuelCasellas
Copy link
Author

It seems this functionality was already attempted but was never merged: #4051

@unixfox
Copy link
Member

unixfox commented Jan 10, 2025

It seems this functionality was already attempted but was never merged: #4051

Please split that into a separate PR. Keep this PR originally for js refactoring and create a new PR for fixing specifically for the other fix.

@SamuelCasellas SamuelCasellas changed the title "Could not fetch comments" Message Reformatting and Refactoring Jan 11, 2025
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.

3 participants