mirror of
https://github.com/lingble/chatwoot.git
synced 2025-12-05 04:15:17 +00:00
chore: floating call button
This commit is contained in:
@@ -110,12 +110,23 @@ export const hasValidAvatarUrl = avatarUrl => {
|
||||
};
|
||||
|
||||
export const timeStampAppendedURL = dataUrl => {
|
||||
const url = new URL(dataUrl);
|
||||
if (!url.searchParams.has('t')) {
|
||||
url.searchParams.append('t', Date.now());
|
||||
}
|
||||
try {
|
||||
// Make sure the URL is valid before trying to construct it
|
||||
if (!dataUrl || typeof dataUrl !== 'string') {
|
||||
return '';
|
||||
}
|
||||
|
||||
return url.toString();
|
||||
const url = new URL(dataUrl);
|
||||
if (!url.searchParams.has('t')) {
|
||||
url.searchParams.append('t', Date.now());
|
||||
}
|
||||
|
||||
return url.toString();
|
||||
} catch (error) {
|
||||
// If URL construction fails, just return the original URL
|
||||
console.error('Invalid URL in timeStampAppendedURL:', error);
|
||||
return dataUrl || '';
|
||||
}
|
||||
};
|
||||
|
||||
export const getHostNameFromURL = url => {
|
||||
|
||||
Reference in New Issue
Block a user