Skip to content

Commit

Permalink
fix bug where setting favorite on first app open, favorite icon does …
Browse files Browse the repository at this point in the history
…not update
  • Loading branch information
bwees committed Jan 17, 2024
1 parent 2e4dd9d commit 5158c26
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/components/ui/FavoritePill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
import {FontAwesome} from '@expo/vector-icons';

import IconPill from './IconPill'
import { set } from 'zod';

Check failure on line 7 in app/components/ui/FavoritePill.tsx

View workflow job for this annotation

GitHub Actions / tsc

'set' is declared but its value is never read.

interface Props {
routeId: string
Expand Down Expand Up @@ -41,6 +42,7 @@ const FavoritePill: React.FC<Props> = ({ routeId }) => {
try {
// If no favorites exist and we are adding favorite, create a new array with the routeId
if (!savedFavorites && newState) {
setIsFavorite(true);
return AsyncStorage.setItem('favorites', JSON.stringify([routeId]));
}

Expand Down

0 comments on commit 5158c26

Please sign in to comment.