fix: rpc function
This commit is contained in:
@@ -57,7 +57,7 @@ export function convertDriveUrlToDirect(url) {
|
||||
return `https://drive.google.com/thumbnail?id=${match[1]}&sz=w1000`;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Error convirtiendo la URL de Drive:", e);
|
||||
// ignore
|
||||
}
|
||||
return url;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ export async function fetchImageAsBlob(url) {
|
||||
const response = await fetch(url);
|
||||
if (response.ok) return await response.blob();
|
||||
} catch (e) {
|
||||
console.error("Error al obtener Blob local de URL blob/data:", e);
|
||||
// ignore
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -80,7 +80,7 @@ export async function fetchImageAsBlob(url) {
|
||||
const response = await fetch(url);
|
||||
if (response.ok) return await response.blob();
|
||||
} catch {
|
||||
console.warn("No se pudo obtener el Blob directo de Drive debido a restricciones CORS.");
|
||||
// CORS blocked
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -91,7 +91,6 @@ export async function fetchImageAsBlob(url) {
|
||||
if (!response.ok) throw new Error("Error en respuesta de red proxy");
|
||||
return await response.blob();
|
||||
} catch (e) {
|
||||
console.error("Error haciendo fetch con bypass CORS a la imagen externa:", e);
|
||||
try {
|
||||
const response = await fetch(url, { mode: 'cors' });
|
||||
return await response.blob();
|
||||
@@ -269,7 +268,7 @@ export async function downloadIDCards(config) {
|
||||
const backCanvas = await html2canvasLib(vBack, renderOpts);
|
||||
executeFileDownload(backCanvas.toDataURL('image/png'), `${cleanName}Reverso.png`);
|
||||
} catch (error) {
|
||||
console.error('Error generando las vistas en alta resolución:', error);
|
||||
// silent
|
||||
} finally {
|
||||
if (sandbox.parentNode) document.body.removeChild(sandbox);
|
||||
if (onStateChange) onStateChange({ processing: false, text: '⬇ Descargar' });
|
||||
@@ -334,7 +333,7 @@ export async function downloadBulkIDCards({ employees, baseUrl, onStateChange, o
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(`Error guardando foto en Supabase para Cédula: ${strictCleanId}`, err);
|
||||
// silent
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user