Skip to content

Commit 3f7cf54

Browse files
Update WhatsApp redirect to remove unnecessary variables
Simplified the WhatsApp redirect logic by removing unused variables and references to the signed route and chat data. The phone number is now sanitized directly in the redirect URL to ensure proper formatting.
1 parent 88c77cd commit 3f7cf54

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

resources/views/whatsapp-redirect.blade.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
<meta name="robots" content="noindex, nofollow">
99
<script type='text/javascript'>
1010
/* <![CDATA[ */
11-
var ww_whatsapp_chat = "{{ URL::signedRoute('whatsapp-widget.api') }}";
12-
var ww_whatsapp_chat_data = "agent={{ $whatsappAgent->id }}&number={{ $whatsappAgent->phone }}&type=click&ref={{ config('whatsapp-widget.url') }}";
13-
var ww_whatsapp_chat_redirect = "https://wa.me/{{ $whatsappAgent->phone }}?text={{ urlencode($whatsappAgent->text) }}";
11+
var ww_whatsapp_chat_redirect = "https://wa.me/{{ str_replace('+', '', $whatsappAgent->phone) }}?text={{ urlencode($whatsappAgent->text) }}";
1412
/* ]]> */
1513
</script>
1614
@vite('resources/css/wa-redirect.css', "vendor/whatsapp-widget")
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
@vite('resources/css/app.css', "vendor/whatsapp-widget")
2-
<script type='text/javascript'>var ww_whatsapp_chat = "{{ URL::signedRoute('whatsapp-widget.api') }}";</script>
32
@vite('resources/js/app.js', "vendor/whatsapp-widget")

0 commit comments

Comments
 (0)