Skip to content

fix: replace undeclared body variable with document.body in theme preference loading#5891

Open
AdityaM-IITH wants to merge 1 commit intosugarlabs:masterfrom
AdityaM-IITH:fix-undeclared-body-in-theme-loader
Open

fix: replace undeclared body variable with document.body in theme preference loading#5891
AdityaM-IITH wants to merge 1 commit intosugarlabs:masterfrom
AdityaM-IITH:fix-undeclared-body-in-theme-loader

Conversation

@AdityaM-IITH
Copy link
Contributor

What:

  • Replaced two references to undeclared variable body with document.body
    in the theme preference loading logic in the Activity constructor.

Why:

  • body was never declared in this scope, causing a ReferenceError silently
    swallowed by the surrounding try/catch block.
  • This meant stored theme preference was never actually applied on load.
  • document.body is already used elsewhere in this file, making this the
    correct and consistent reference.

How:

  • Minimal two-line change, no logic modification.

@github-actions
Copy link
Contributor

❌ Some Jest tests failed. Please check the logs and fix the issues before merging.

Failed Tests:

palette.test.js
logo.test.js
logoconstants.test.js

@AdityaM-IITH AdityaM-IITH force-pushed the fix-undeclared-body-in-theme-loader branch from b18a605 to 555e4b0 Compare February 24, 2026 18:04
@AdityaM-IITH
Copy link
Contributor Author

Rebased on latest master (83c5c8d). All 117 test suites passing locally.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

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.

1 participant