s/readingTime/readTimeMs/g

This commit is contained in:
0x1eef 2022-11-01 23:28:03 -03:00
parent cbcb909ced
commit 36f21c8936
2 changed files with 4 additions and 4 deletions

View file

@ -9,8 +9,8 @@ type TimerProps = {
}; };
export function Timer({surah, ayah, stream, setStream}: TimerProps) { export function Timer({surah, ayah, stream, setStream}: TimerProps) {
const [ms, setMs] = useState(ayah.readingTime); const [ms, setMs] = useState(ayah.readTimeMs);
useEffect(() => setMs(ayah.readingTime), [ayah]); useEffect(() => setMs(ayah.readTimeMs), [ayah]);
useEffect(() => { useEffect(() => {
if (stream.length === surah.ayat.length) { if (stream.length === surah.ayat.length) {
return; return;

View file

@ -7,7 +7,7 @@ type SurahDetails = {
slug: string, slug: string,
codepoints: Array<number> codepoints: Array<number>
} }
export type Ayah = {id: number, text: string, readingTime: number}; export type Ayah = {id: number, text: string, readTimeMs: number};
export type Ayat = Array<Ayah>; export type Ayat = Array<Ayah>;
export class Surah { export class Surah {
@ -20,7 +20,7 @@ export class Surah {
ayat.map(([id, text]) => { ayat.map(([id, text]) => {
return { return {
id, text, id, text,
readingTime: text.split(" ").length * 500, readTimeMs: text.split(" ").length * 500,
} }
}) })
); );