Skip to content

Commit

Permalink
fix: 🐛 Theme, Following screen's loading and CWInfo
Browse files Browse the repository at this point in the history
Fixed:
- Theme changes to light mode when registering
- CWInfo aligned
- Following screen's loading was infinity when follows were at 0

Notes:
- Node 18.16.0 (which is 18.x at the commit date) version fails to generate coverage when using Jest in the GitHub Action. Using 18.15.0 version for the moment until another update release, see: facebook/react-native#36440 (comment)
  • Loading branch information
IvanGodinez21 committed Apr 22, 2023
1 parent 7bfb049 commit adcc637
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: 🏗️ Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 18.15.0
cache: npm

- name: 📦 Install dependencies
Expand Down
3 changes: 2 additions & 1 deletion App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export default class App extends Component<object, IAppState> {
return auth().onAuthStateChanged(async (user) => {
if (user) {
const querySnapshot = await firestore().collection('users').doc(auth().currentUser?.uid).get();
EventRegister.emit('changeTheme', querySnapshot.data()?.settings.theme);
const theme = querySnapshot.data()?.settings.theme;
if (theme) EventRegister.emit('changeTheme', theme);
}
});
};
Expand Down
4 changes: 2 additions & 2 deletions src/screens/Following.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class LogIn extends Component<IFollowingProps, IFollowingState> {
super(props);
this.state = {
search: '',
following: [],
following: undefined,
};
}

Expand Down Expand Up @@ -46,7 +46,7 @@ export default class LogIn extends Component<IFollowingProps, IFollowingState> {
}

render() {
if (this.state.following.length) {
if (this.state.following && this.state.following.length >= 0) {
return (
<View style={FollowingStyles(this.context).screen.style.container}>
<FlatList
Expand Down
2 changes: 0 additions & 2 deletions src/styles/components/CWInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { IThemeContext } from '../../types/theme/context';
export default (context: IThemeContext) => {
return {
container: {
width: '100%',
height: 60,
borderRadius: 8,
backgroundColor: context.colors.card,
flexDirection: 'row',
Expand Down
2 changes: 1 addition & 1 deletion src/types/screens/Following.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export type IFollowingProps = NativeStackScreenProps<RootStackParamList, 'Follow

export type IFollowingState = {
search: string;
following: OWMALocationAndWeather[];
following?: OWMALocationAndWeather[];
};

0 comments on commit adcc637

Please sign in to comment.