- removed console.logs
This commit is contained in:
@@ -22,7 +22,6 @@ const SoundUpload = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleSubmit = async (values: SoundUploadValue) => {
|
const handleSubmit = async (values: SoundUploadValue) => {
|
||||||
console.log(values);
|
|
||||||
if (!values.soundFile) {
|
if (!values.soundFile) {
|
||||||
toast.warning("Please select an audio file");
|
toast.warning("Please select an audio file");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ const uploadFile = async (file: File) => {
|
|||||||
|
|
||||||
const getUploadFiles = async ({ queryKey }: { queryKey: string[] }) => {
|
const getUploadFiles = async ({ queryKey }: { queryKey: string[] }) => {
|
||||||
const [, fileName] = queryKey;
|
const [, fileName] = queryKey;
|
||||||
|
|
||||||
// console.log(`${camBase}/Mobile/${fileName}`);
|
|
||||||
const url = fileName;
|
const url = fileName;
|
||||||
return getOrCacheBlob(url);
|
return getOrCacheBlob(url);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
export async function getOrCacheBlob(url: string) {
|
export async function getOrCacheBlob(url: string) {
|
||||||
console.log(url);
|
|
||||||
const cache = await caches.open("app-sounds-v1");
|
const cache = await caches.open("app-sounds-v1");
|
||||||
if (cache) console.log(cache);
|
|
||||||
const hit = await cache.match(url);
|
const hit = await cache.match(url);
|
||||||
if (hit) return await hit.blob();
|
if (hit) return await hit.blob();
|
||||||
|
|
||||||
const res = await fetch(url, { cache: "no-store" });
|
const res = await fetch(url, { cache: "no-store" });
|
||||||
console.log("fetching...");
|
|
||||||
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
|
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
|
||||||
|
|
||||||
await cache.put(url, res.clone());
|
await cache.put(url, res.clone());
|
||||||
|
|||||||
Reference in New Issue
Block a user