Skip to content

Commit 70a1ea4

Browse files
authored
Merge pull request #15191 from ethereum/listenToSlugNormalizing
Listen to feature slug normalizing
2 parents a55dee7 + a392155 commit 70a1ea4

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)