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

Update Dark.js #17670

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Update Dark.js #17670

wants to merge 1 commit into from

Conversation

diadal
Copy link
Contributor

@diadal diadal commented Dec 1, 2024

this helps to know if the device is in dark mode or not

What kind of change does this PR introduce?

  • Bugfix
  • [ *] Feature
  • Documentation
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes
  • [* ] No

The PR fulfills these requirements:

  • [ dev] It's submitted to the dev branch (or v[X] branch)
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)
  • It's been tested on a Cordova (iOS, Android) app
  • It's been tested on an Electron app
  • Any necessary documentation has been added or updated in the docs or explained in the PR's description.

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to start a new feature discussion first and wait for approval before working on it)

Other information:

this helps to know if the device is in dark mode or not
Copy link

github-actions bot commented Dec 1, 2024

UI Tests Results

    1 files   98 suites   4s ⏱️
1 031 tests 523 ✅ 0 💤 508 ❌
1 050 runs  542 ✅ 0 💤 508 ❌

For more details on these failures, see this check.

Results for commit 2deb986.

Copy link
Member

@rstoenescu rstoenescu left a comment

Choose a reason for hiding this comment

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

Hi,

Thank you for contributing!
Please take a look at my comments. Would help with it, but I have no bandwidth for it at the moment.

You can test with "pnpm dev:ssr" and "pnpm dev" in /ui.
When you're ready, a "pnpm build" without errors would ensure it passes the shallow validation for JSON also.

Plugin.mode = val
Plugin.isEnabled = matchMedia.matches
Copy link
Member

Choose a reason for hiding this comment

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

isPreferred would be better otherwise it is confusing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok i will update this

@@ -42,15 +45,18 @@ const Plugin = createReactivePlugin({

if (__QUASAR_SSR_SERVER__) {
this.isActive = dark === true
this.isEnabled = matchMedia.matches
Copy link
Member

Choose a reason for hiding this comment

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

There is no matchMedia here, nor can it be. This code runs on the server. It should be defaulted to a value (probably false) and updated only on client takeover, otherwise there will be hydration errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

noted

@@ -1,6 +1,7 @@
import { createReactivePlugin } from '../../utils/private.create/create.js'

const Plugin = createReactivePlugin({
isEnabled: false,
Copy link
Member

Choose a reason for hiding this comment

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

Should be added to Dark.json too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did that on but i will update it to isPreferred

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.

2 participants