better truncating of hrefs

This commit is contained in:
Leon van Kammen 2024-10-14 11:53:00 +02:00
parent e0ee7e10e0
commit 28770956b4
1 changed files with 3 additions and 1 deletions

View File

@ -106,7 +106,9 @@ window.frontend = (opts) => new Proxy({
let topic = data.xrf ? data.xrf.string : data.mesh.userData.src
if( topic.length > 20 ) topic = topic.replace(/.*\//,'')
if( topic.match(/\.\.\//) || (topic.length > 20 && AFRAME.utils.device.isMobile() ) ){
topic = topic.replace(/.*\//,'')
}
let html = this.notify_links ? `<b class="badge">${data.mesh.isSRC && !data.mesh.portal ? 'src' : 'href'}</b>${ topic }<br>` : ''
let metadata = data.mesh.userData