fix: Actualizar con branding de GLM y restringir acceso con Supabase.
This commit is contained in:
@@ -53,9 +53,7 @@ export function usePricingSummaryVisibility(enabled = true) {
|
||||
} catch (err) {
|
||||
console.error("No se pudo leer la visibilidad del total tarifado:", err);
|
||||
setError(
|
||||
err instanceof Error
|
||||
? err.message
|
||||
: "No se pudo leer la visibilidad del total tarifado.",
|
||||
err instanceof Error ? err.message : "No se pudo leer la visibilidad del total tarifado.",
|
||||
);
|
||||
return false;
|
||||
} finally {
|
||||
@@ -63,29 +61,26 @@ export function usePricingSummaryVisibility(enabled = true) {
|
||||
}
|
||||
}, [enabled]);
|
||||
|
||||
const setPublicVisibility = useCallback(
|
||||
async (nextIsPublic: boolean) => {
|
||||
setSaving(true);
|
||||
setError(null);
|
||||
const setPublicVisibility = useCallback(async (nextIsPublic: boolean) => {
|
||||
setSaving(true);
|
||||
setError(null);
|
||||
|
||||
try {
|
||||
await savePricingSummaryPublicVisibility(nextIsPublic);
|
||||
setIsPublic(nextIsPublic);
|
||||
return nextIsPublic;
|
||||
} catch (err) {
|
||||
console.error("No se pudo actualizar la visibilidad del total tarifado:", err);
|
||||
setError(
|
||||
err instanceof Error
|
||||
? err.message
|
||||
: "No se pudo actualizar la visibilidad del total tarifado.",
|
||||
);
|
||||
throw err;
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
},
|
||||
[],
|
||||
);
|
||||
try {
|
||||
await savePricingSummaryPublicVisibility(nextIsPublic);
|
||||
setIsPublic(nextIsPublic);
|
||||
return nextIsPublic;
|
||||
} catch (err) {
|
||||
console.error("No se pudo actualizar la visibilidad del total tarifado:", err);
|
||||
setError(
|
||||
err instanceof Error
|
||||
? err.message
|
||||
: "No se pudo actualizar la visibilidad del total tarifado.",
|
||||
);
|
||||
throw err;
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
void refresh();
|
||||
|
||||
Reference in New Issue
Block a user