This commit is contained in:
afkarxyz
2026-03-25 21:06:45 +07:00
parent ff14990bd8
commit f13359df7f
49 changed files with 4669 additions and 1477 deletions
+2
View File
@@ -1,5 +1,6 @@
import { useState, useEffect } from "react";
import { GetPreviewURL } from "@/../wailsjs/go/main/App";
import { SPOTIFY_PREVIEW_VOLUME } from "@/lib/preview";
import { toast } from "sonner";
export function usePreview() {
const [loadingPreview, setLoadingPreview] = useState<string | null>(null);
@@ -38,6 +39,7 @@ export function usePreview() {
return;
}
const audio = new Audio(previewURL);
audio.volume = SPOTIFY_PREVIEW_VOLUME;
audio.addEventListener("loadeddata", () => {
setLoadingPreview(null);
setPlayingTrack(trackId);