diff --git a/app/javascript/dashboard/components-next/message/bubbles/Audio.vue b/app/javascript/dashboard/components-next/message/bubbles/Audio.vue index f556cd3e5..79d866c09 100644 --- a/app/javascript/dashboard/components-next/message/bubbles/Audio.vue +++ b/app/javascript/dashboard/components-next/message/bubbles/Audio.vue @@ -4,7 +4,6 @@ import BaseBubble from './Base.vue'; import AudioChip from 'next/message/chips/Audio.vue'; import Icon from 'next/icon/Icon.vue'; import { useLoadWithRetry } from 'dashboard/composables/loadWithRetry'; -import { timeStampAppendedURL } from 'dashboard/helper/URLHelper'; import { useMessageContext } from '../provider.js'; const { attachments } = useMessageContext(); @@ -19,7 +18,7 @@ const { isLoaded, hasError, loadWithRetry } = useLoadWithRetry({ onMounted(() => { if (attachment.value?.dataUrl) { - loadWithRetry(timeStampAppendedURL(attachment.value.dataUrl)); + loadWithRetry(attachment.value.dataUrl); } }); diff --git a/app/javascript/dashboard/composables/loadWithRetry.js b/app/javascript/dashboard/composables/loadWithRetry.js index f57fdf9a2..af28f2e83 100644 --- a/app/javascript/dashboard/composables/loadWithRetry.js +++ b/app/javascript/dashboard/composables/loadWithRetry.js @@ -27,7 +27,9 @@ export const useLoadWithRetry = (config = {}) => { element.onload = onSuccess; } element.onerror = () => reject(new Error('Failed to load resource')); - element.src = url; + const cacheBustedUrl = new URL(url); + cacheBustedUrl.searchParams.set('t', Date.now()); + element.src = cacheBustedUrl.toString(); }); };