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 the dark mode release from iOS background #162

Merged

Conversation

Jay-flow
Copy link
Contributor

@Jay-flow Jay-flow commented Nov 4, 2021

Description

I modified the release of dark mode in iOS background.
This is a bug in the addChangeListener, a method of the Appearance in react-native.
This is a bug that only happens in iOS. Issue link

Despite the dark theme, the color Scheme variable is initialized to light when switching to background.

// File path: dooboo-ui/packages/theme/useColorScheme.ts

const listener = ({colorScheme}): void => {
   setColorType(colorScheme);
};

To solve this problem, I changed it to match the color by calling Appearance.getColorScheme() again when the listener is called.

Before

bug.mov

After

fix.mov

Test Plan

N/A

Related Issues

N/A

Tests

N/A

Checklist

Before you create this PR confirms that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • Run yarn test:all and make sure nothing fails. You can run yarn test -u to update snapshots if needed.
  • I am willing to follow-up on review comments in a timely manner.

@codecov
Copy link

codecov bot commented Nov 4, 2021

Codecov Report

Merging #162 (050a0b0) into master (773ceaf) will decrease coverage by 0.13%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #162      +/-   ##
==========================================
- Coverage   93.44%   93.31%   -0.14%     
==========================================
  Files          27       27              
  Lines         702      703       +1     
  Branches      297      298       +1     
==========================================
  Hits          656      656              
- Misses         46       47       +1     

@Jay-flow Jay-flow changed the title Fix/dark theme ios bug Fix the dark mode release from iOS background Nov 4, 2021
@yujonglee yujonglee self-requested a review November 4, 2021 06:20
Copy link
Contributor

@yujonglee yujonglee left a comment

Choose a reason for hiding this comment

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

Great explanations. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍗 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants