forked from git.gladyson/openmonetis
fix: melhorar validação de URL do logo do cartão
- Verificar se logo começa com /, http:// ou https:// - Prevenir erro com logos que são apenas nomes de arquivo - Exibir fallback quando logo não é uma URL válida
This commit is contained in:
@@ -34,8 +34,13 @@ export function InstallmentGroupCard({
|
|||||||
|
|
||||||
const unpaidCount = unpaidInstallments.length;
|
const unpaidCount = unpaidInstallments.length;
|
||||||
|
|
||||||
// Validar se o logo é uma URL válida
|
// Validar se o logo é uma URL válida (deve começar com / ou http:// ou https://)
|
||||||
const isValidLogo = group.cartaoLogo && group.cartaoLogo.trim().length > 0;
|
const isValidLogo =
|
||||||
|
group.cartaoLogo &&
|
||||||
|
group.cartaoLogo.trim().length > 0 &&
|
||||||
|
(group.cartaoLogo.startsWith('/') ||
|
||||||
|
group.cartaoLogo.startsWith('http://') ||
|
||||||
|
group.cartaoLogo.startsWith('https://'));
|
||||||
|
|
||||||
const isFullySelected =
|
const isFullySelected =
|
||||||
selectedInstallments.size === unpaidInstallments.length &&
|
selectedInstallments.size === unpaidInstallments.length &&
|
||||||
|
|||||||
Reference in New Issue
Block a user