Compare commits

..

No commits in common. "60ce765193eb17e1986cd5bb02ceb6379995d833" and "77018ef252b442804caeeb03873bb1cd6608f5e7" have entirely different histories.

2 changed files with 2 additions and 14 deletions

View File

@ -8,7 +8,6 @@
import ExtraEntryInfo from "../components/ExtraEntryInfo";
import classNames from "classnames";
import { Types as T, InlinePs } from "@lingdocs/ps-react";
import playStorageAudio from "./PlayStorageAudio";
function Entry({
entry,
@ -21,12 +20,6 @@ function Entry({
nonClickable?: boolean;
isolateEntry?: (ts: number) => void;
}) {
function handlePlayStorageAudio(
e: React.MouseEvent<HTMLElement, MouseEvent>
) {
e.stopPropagation();
playStorageAudio(entry.ts, () => null);
}
return (
<div
className={classNames("entry", { clickable: !nonClickable })}
@ -41,12 +34,7 @@ function Entry({
</strong>
{` `}
<em>{entry.c}</em>
{entry.a && !nonClickable && (
<i
onClick={handlePlayStorageAudio}
className="clickable ml-2 fas fa-volume-down"
/>
)}
{entry.a && !nonClickable && <i className="ml-2 fas fa-volume-down" />}
</div>
<ExtraEntryInfo entry={entry} textOptions={textOptions} />
<div className="entry-definition">{entry.e}</div>

View File

@ -1,6 +1,6 @@
export default function playStorageAudio(ts: number, callback: () => void) {
if (!ts) return;
let audio = new Audio(`https://storage.lingdocs.com/audio/${ts}.mp3`);
let audio = new Audio(`https://storage.lingdocs.com/${ts}.mp3`);
audio.addEventListener("ended", () => {
callback();
audio.remove();