File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ export function AddItems({ items }) {
48
48
`${ itemName } was added to the list! The next purchase date is set to ${ daysUntilNextPurchase } days from now.` ,
49
49
) ;
50
50
} catch ( error ) {
51
- alert ( `Item was not added to the itemsbase , Error: ${ error . message } ` ) ;
51
+ alert ( `Item was not added to the database , Error: ${ error . message } ` ) ;
52
52
} finally {
53
53
event . target . reset ( ) ;
54
54
}
Original file line number Diff line number Diff line change @@ -8,13 +8,13 @@ const currentDate = new Date();
8
8
const calculateIsPurchased = ( dateLastPurchased ) => {
9
9
if ( ! dateLastPurchased ) {
10
10
return false ;
11
- } else {
12
- const purchaseDate = dateLastPurchased . toDate ( ) ;
13
- const oneDayLater = new Date (
14
- purchaseDate . getTime ( ) + ONE_DAY_IN_MILLISECONDS ,
15
- ) ;
16
- return currentDate < oneDayLater ;
17
11
}
12
+ const purchaseDate = dateLastPurchased . toDate ( ) ;
13
+ const oneDayLater = new Date (
14
+ purchaseDate . getTime ( ) + ONE_DAY_IN_MILLISECONDS ,
15
+ ) ;
16
+
17
+ return currentDate < oneDayLater ;
18
18
} ;
19
19
20
20
export function ListItem ( { item, listPath } ) {
You can’t perform that action at this time.
0 commit comments