fix: usar número do WhatsApp correto direto sem puxar do banco
This commit is contained in:
@@ -12,16 +12,10 @@ export default function WhatsAppButton() {
|
||||
useEffect(() => {
|
||||
setMounted(true);
|
||||
|
||||
// Busca o número do WhatsApp das configurações
|
||||
fetch('/api/settings')
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
if (data.whatsapp) {
|
||||
const cleanNumber = data.whatsapp.replace(/\D/g, '');
|
||||
setWhatsappLink(`https://api.whatsapp.com/send/?phone=${cleanNumber}&text&type=phone_number&app_absent=0`);
|
||||
}
|
||||
})
|
||||
.catch(console.error);
|
||||
// Usa o número padrão correto
|
||||
// Se precisar atualizar no futuro, mude aqui
|
||||
const defaultNumber = '553598829445';
|
||||
setWhatsappLink(`https://api.whatsapp.com/send/?phone=${defaultNumber}&text&type=phone_number&app_absent=0`);
|
||||
}, []);
|
||||
|
||||
if (!mounted) {
|
||||
|
||||
Reference in New Issue
Block a user