mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-11 00:43:40 +02:00
Fix relay icons when using complete ui
This commit is contained in:
@@ -65,6 +65,7 @@ fun BasicRelaySetupInfoClickableRow(
|
|||||||
iconUrlFromRelayInfoDoc ?: item.briefInfo.favIcon,
|
iconUrlFromRelayInfoDoc ?: item.briefInfo.favIcon,
|
||||||
loadProfilePicture,
|
loadProfilePicture,
|
||||||
loadRobohash,
|
loadRobohash,
|
||||||
|
item.relayStat.pingInMs,
|
||||||
MaterialTheme.colorScheme.largeRelayIconModifier,
|
MaterialTheme.colorScheme.largeRelayIconModifier,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -322,6 +322,7 @@ fun ClickableRelayItem(
|
|||||||
iconUrlFromRelayInfoDoc ?: item.briefInfo.favIcon,
|
iconUrlFromRelayInfoDoc ?: item.briefInfo.favIcon,
|
||||||
loadProfilePicture,
|
loadProfilePicture,
|
||||||
loadRobohash,
|
loadRobohash,
|
||||||
|
item.relayStat.pingInMs,
|
||||||
MaterialTheme.colorScheme.largeRelayIconModifier,
|
MaterialTheme.colorScheme.largeRelayIconModifier,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -93,6 +93,7 @@ fun Kind3RelaySetupInfoProposalRow(
|
|||||||
iconUrlFromRelayInfoDoc ?: item.briefInfo.favIcon,
|
iconUrlFromRelayInfoDoc ?: item.briefInfo.favIcon,
|
||||||
loadProfilePicture,
|
loadProfilePicture,
|
||||||
loadRobohash,
|
loadRobohash,
|
||||||
|
item.relayStat.pingInMs,
|
||||||
MaterialTheme.colorScheme.largeRelayIconModifier,
|
MaterialTheme.colorScheme.largeRelayIconModifier,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -135,6 +135,7 @@ fun RelayInformationDialog(
|
|||||||
iconUrl = relayInfo.icon ?: relayBriefInfo.favIcon,
|
iconUrl = relayInfo.icon ?: relayBriefInfo.favIcon,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures.value,
|
loadProfilePicture = accountViewModel.settings.showProfilePictures.value,
|
||||||
loadRobohash = accountViewModel.settings.featureSet != FeatureSetType.PERFORMANCE,
|
loadRobohash = accountViewModel.settings.featureSet != FeatureSetType.PERFORMANCE,
|
||||||
|
RelayStats.get(url = relayBriefInfo.url).pingInMs,
|
||||||
iconModifier = MaterialTheme.colorScheme.largeRelayIconModifier,
|
iconModifier = MaterialTheme.colorScheme.largeRelayIconModifier,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@@ -62,8 +62,6 @@ import com.vitorpamplona.amethyst.ui.theme.StdStartPadding
|
|||||||
import com.vitorpamplona.amethyst.ui.theme.placeholderText
|
import com.vitorpamplona.amethyst.ui.theme.placeholderText
|
||||||
import com.vitorpamplona.amethyst.ui.theme.relayIconModifier
|
import com.vitorpamplona.amethyst.ui.theme.relayIconModifier
|
||||||
import com.vitorpamplona.ammolite.relays.RelayBriefInfoCache
|
import com.vitorpamplona.ammolite.relays.RelayBriefInfoCache
|
||||||
import com.vitorpamplona.ammolite.relays.RelayStats
|
|
||||||
import com.vitorpamplona.quartz.encoders.RelayUrlFormatter
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
public fun RelayBadgesHorizontal(
|
public fun RelayBadgesHorizontal(
|
||||||
@@ -189,6 +187,7 @@ fun RenderRelay(
|
|||||||
displayUrl = relay.displayUrl,
|
displayUrl = relay.displayUrl,
|
||||||
iconUrl = relayInfo?.icon ?: relay.favIcon,
|
iconUrl = relayInfo?.icon ?: relay.favIcon,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures.value,
|
loadProfilePicture = accountViewModel.settings.showProfilePictures.value,
|
||||||
|
pingInMs = 0,
|
||||||
loadRobohash = accountViewModel.settings.featureSet != FeatureSetType.PERFORMANCE,
|
loadRobohash = accountViewModel.settings.featureSet != FeatureSetType.PERFORMANCE,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -200,6 +199,7 @@ fun RenderRelayIcon(
|
|||||||
iconUrl: String?,
|
iconUrl: String?,
|
||||||
loadProfilePicture: Boolean,
|
loadProfilePicture: Boolean,
|
||||||
loadRobohash: Boolean,
|
loadRobohash: Boolean,
|
||||||
|
pingInMs: Long,
|
||||||
iconModifier: Modifier = MaterialTheme.colorScheme.relayIconModifier,
|
iconModifier: Modifier = MaterialTheme.colorScheme.relayIconModifier,
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
@@ -214,7 +214,7 @@ fun RenderRelayIcon(
|
|||||||
loadProfilePicture = loadProfilePicture,
|
loadProfilePicture = loadProfilePicture,
|
||||||
loadRobohash = loadRobohash,
|
loadRobohash = loadRobohash,
|
||||||
)
|
)
|
||||||
|
if (pingInMs > 0) {
|
||||||
Box(
|
Box(
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
@@ -223,7 +223,6 @@ fun RenderRelayIcon(
|
|||||||
Color.Gray,
|
Color.Gray,
|
||||||
),
|
),
|
||||||
) {
|
) {
|
||||||
val pingInMs = RelayStats.get(RelayUrlFormatter.normalize(displayUrl)).pingInMs
|
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier.padding(4.dp),
|
modifier = Modifier.padding(4.dp),
|
||||||
style =
|
style =
|
||||||
@@ -241,4 +240,5 @@ fun RenderRelayIcon(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user