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: remove console log messages on theme change #832

Conversation

harmeetsingh11
Copy link
Contributor

Issue that this pull request solves

Closes: #826

Proposed changes

This pull request addresses the issue of console log messages appearing when the theme is changed. The presence of these log messages is undesirable and can affect the user experience. The proposed changes aim to fix or remove the console log statements related to theme changes.

Changes:

  • Identified and rectified console log messages triggered during theme changes.
  • Removed unnecessary or debug log statements associated with theme transitions.

Testing:

  • Manually tested the application to ensure that console logs are appropriately managed when changing the theme.

Types of changes

Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (Documentation content changed)
  • Other (please describe):

Checklist

Put an x in the boxes that apply

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • My changes does not break the current system and it passes all the current test cases.

@thevirengarg please review this PR.
Thanks

@thevirengarg thevirengarg added Swoc level1 Wiki or Major Documentation work. level0 Minor Documentation work. and removed level1 Wiki or Major Documentation work. labels Jan 16, 2024
frontend/src/app.js Outdated Show resolved Hide resolved
@@ -58,10 +58,6 @@ const App = () => {
localStorage.setItem("dark", !theme);
}

useEffect(() => {
Copy link
Member

Choose a reason for hiding this comment

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

If u remove the useEffect here, how will the component re-render after the theme change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Kajol-Kumari I think in this case it doesn't perform any side effects or log messages based on theme changes, and if the component doesn't rely on these changes to trigger a re-render, we can safely remove the useEffect block. The component will still re-render when its state or props change. What are your thoughts on this?

Copy link
Member

@Kajol-Kumari Kajol-Kumari left a comment

Choose a reason for hiding this comment

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

LGTM

@Kajol-Kumari Kajol-Kumari added the gssoc GSSoC'24 Label label Jan 20, 2024
@Kajol-Kumari Kajol-Kumari merged commit fd4f33d into HITK-TECH-Community:main Jan 20, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc GSSoC'24 Label level0 Minor Documentation work. Swoc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: Address Console Logs When Switching Theme
4 participants