Skip to content

Commit a392155

Browse files
committed
Normalize slug
1 parent a55dee7 commit a392155

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/data/listen-to-feature/playlist.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { normalizeSlug } from "@/lib/utils/url"
2+
13
import ethAudio from "@/data/audio/eth/eth.mp3"
24
import smartContractsAudio from "@/data/audio/smart-contracts/smart-contracts.mp3"
35
import walletsAudio from "@/data/audio/wallets/wallets.mp3"
@@ -41,7 +43,9 @@ export const getPlaylistBySlug = (
4143
index: number
4244
} => {
4345
for (const playlist of Object.values(listenToPlaylists)) {
44-
const index = playlist.findIndex((item) => item.slug === slug)
46+
const index = playlist.findIndex(
47+
(item) => normalizeSlug(item.slug) === normalizeSlug(slug)
48+
)
4549
if (index !== -1) {
4650
return { playlist, index }
4751
}

0 commit comments

Comments
 (0)