Skip to content

Commit ab13802

Browse files
committed
fix: reorder warning log for caching function failure
1 parent 3217a01 commit ab13802

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hooks/useCachedData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ export function useCachedData(playlists: Playlist[] | null) {
3939
const result = mockCachePlaylists(playlists)
4040

4141
if (result !== false) {
42-
console.warn('Caching function returned false, not updating local storage.')
43-
4442
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(playlists))
4543
setCachedPlaylists(playlists)
44+
} else {
45+
console.warn('Caching function returned false, not updating local storage.')
4646
}
4747

4848
console.log('Playlists cached:', playlists)

0 commit comments

Comments
 (0)