diff --git a/src/js/components/SurahStream/Stream.tsx b/src/js/components/SurahStream/Stream.tsx index ddb476d..dbed6a9 100644 --- a/src/js/components/SurahStream/Stream.tsx +++ b/src/js/components/SurahStream/Stream.tsx @@ -2,7 +2,6 @@ import type { Surah, Ayah, TAyat, TLocale } from "@0x1eef/quran"; import { formatNumber, TFunction } from "~/lib/t"; type Props = { - locale: TLocale; surah: Surah; stream: TAyat; endOfStream: boolean; @@ -11,13 +10,13 @@ type Props = { }; export function Stream({ - locale, surah, stream, endOfStream, isPaused, t, }: Props) { + const { theme, locale } = useContext(SettingsContext); const className = endOfStream || isPaused ? ["scroll-y"] : []; const ulRef = useRef(null); const ul = useMemo(() => { @@ -55,7 +54,7 @@ export function Stream({ el.focus(); el.scrollTop = el.scrollHeight; } - }, [stream.length]); + }, [theme, locale.name, stream.length]); return ul; } diff --git a/src/js/components/SurahStream/index.tsx b/src/js/components/SurahStream/index.tsx index fb368e5..e517c17 100644 --- a/src/js/components/SurahStream/index.tsx +++ b/src/js/components/SurahStream/index.tsx @@ -87,7 +87,6 @@ export function SurahStream({ surahId, localeId, t }: Props) { > {t(locale, "TheNobleQuran")}