🐞 fix: GUI relay display error (#335)

This commit is contained in:
m1m1sha
2024-09-14 11:41:38 +08:00
committed by GitHub
parent 9b28ecde8e
commit cfe4d080d5

View File

@@ -40,13 +40,11 @@ const peerRouteInfos = computed(() => {
})
function routeCost(info: any) {
if (!info.peer)
return t('status.local')
if (info.route) {
const cost = info.route.cost
return cost === 1 ? 'p2p' : `relay(${cost})`
return cost ? cost === 1 ? 'p2p' : `relay(${cost})` : t('status.local')
}
return '?'
}