Skip to content

Commit 44c9b38

Browse files
committed
ui: reorder inbound proxy summary
1 parent 91576f9 commit 44c9b38

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

app/src/main/kotlin/features/settings/SettingsComponents.kt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,23 @@ internal fun inboundProxySummary(
3535
enableSocks5Proxy: Boolean,
3636
enableHttpProxy: Boolean,
3737
): String {
38-
val enabledInbounds = mutableListOf(
39-
stringResource(R.string.settings_inbound_tproxy_port)
40-
.formatTemplate("port" to transparentProxyPort),
41-
)
38+
val tproxyPort = stringResource(R.string.settings_inbound_tproxy_port)
39+
.formatTemplate("port" to transparentProxyPort)
40+
val enabledInbounds = mutableListOf<String>()
4241
if (enableSocks5Proxy) {
4342
enabledInbounds += stringResource(R.string.settings_socks5_proxy)
4443
}
4544
if (enableHttpProxy) {
4645
enabledInbounds += stringResource(R.string.settings_http_proxy)
4746
}
48-
return stringResource(R.string.settings_inbound_selected)
49-
.formatTemplate("inbounds" to enabledInbounds.joinToString())
47+
if (enabledInbounds.isEmpty()) {
48+
return tproxyPort
49+
}
50+
return listOf(
51+
tproxyPort,
52+
stringResource(R.string.settings_inbound_selected)
53+
.formatTemplate("inbounds" to enabledInbounds.joinToString()),
54+
).joinToString()
5055
}
5156

5257
@Composable

0 commit comments

Comments
 (0)