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>
|
<script>
|
||||||
const receiverId = {{ $user->id }};
|
const receiverId = {{ $user->id }};
|
||||||
const authId = {{ auth()->id() }};
|
const authId = {{ auth()->id() }};
|
||||||
|
const storageBase = '{{ rtrim(Storage::url(''), '/') }}';
|
||||||
const chatMessages = document.getElementById('chat-messages');
|
const chatMessages = document.getElementById('chat-messages');
|
||||||
|
|
||||||
// scroll al fondo
|
// scroll al fondo
|
||||||
@@ -118,7 +119,7 @@ document.getElementById('chat-form').addEventListener('submit', function(e) {
|
|||||||
|
|
||||||
function buildAttachmentHtml(msg, isMine) {
|
function buildAttachmentHtml(msg, isMine) {
|
||||||
if (!msg.attachment) return '';
|
if (!msg.attachment) return '';
|
||||||
const url = '/storage/' + msg.attachment;
|
const url = storageBase + '/' + msg.attachment;
|
||||||
const linkClass = isMine ? 'text-white' : 'text-dark';
|
const linkClass = isMine ? 'text-white' : 'text-dark';
|
||||||
switch (msg.attachment_type) {
|
switch (msg.attachment_type) {
|
||||||
case 'image':
|
case 'image':
|
||||||
|
|||||||
Reference in New Issue
Block a user