fix: usar Storage::url() como base para adjuntos en JS (compatible con producción)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -86,6 +86,7 @@
|
||||
<script>
|
||||
const receiverId = {{ $user->id }};
|
||||
const authId = {{ auth()->id() }};
|
||||
const storageBase = '{{ rtrim(Storage::url(''), '/') }}';
|
||||
const chatMessages = document.getElementById('chat-messages');
|
||||
|
||||
// scroll al fondo
|
||||
@@ -118,7 +119,7 @@ document.getElementById('chat-form').addEventListener('submit', function(e) {
|
||||
|
||||
function buildAttachmentHtml(msg, isMine) {
|
||||
if (!msg.attachment) return '';
|
||||
const url = '/storage/' + msg.attachment;
|
||||
const url = storageBase + '/' + msg.attachment;
|
||||
const linkClass = isMine ? 'text-white' : 'text-dark';
|
||||
switch (msg.attachment_type) {
|
||||
case 'image':
|
||||
|
||||
Reference in New Issue
Block a user