Skip to content

Commit 2240514

Browse files
committed
fix: hotfix the ascii player crashed cased by url fragments
1 parent 9362930 commit 2240514

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/components/CliDemo.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { useRouter } from 'next/router';
2-
import { useEffect, useState } from 'react';
2+
import { useEffect, useId, useState } from 'react';
33

44
const CliDemo = ({ castFile, terminalFontSize}) => {
55
const router = useRouter();
66
const [playerInitialized, setPlayerInitialized] = useState(false);
77

8-
// Generate a unique ID for the player container
9-
const uniqueId = `player-container-${Math.random().toString(36).substr(2, 9)}`;
8+
const uniqueId = `player-container-${useId()}`;
109

1110
useEffect(() => {
1211
const initializeAsciinema = () => {

0 commit comments

Comments
 (0)