Skip to content

Commit 0f0e28b

Browse files
committed
Fix label index to comply with bitkit RN
1 parent a5429da commit 0f0e28b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Bitkit/Views/Settings/Advanced/LightningConnectionsView.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,13 @@ struct LightningConnectionsView: View {
7070
.padding(.top, 16)
7171

7272
ForEach(Array(pendingConnections.enumerated()), id: \.element.channelId) { index, channel in
73+
let labelIndex = pendingConnections.count - index
7374
Button {
7475
navigation.navigate(.connectionDetail(channelId: channel.channelIdString))
7576
} label: {
7677
VStack(spacing: 0) {
7778
HStack {
78-
SubtitleText("\(t("lightning__connection")) \(index + 1)")
79+
SubtitleText("\(t("lightning__connection")) \(labelIndex)")
7980
Spacer()
8081
Image("chevron")
8182
.resizable()
@@ -109,12 +110,13 @@ struct LightningConnectionsView: View {
109110
.padding(.top, 16)
110111

111112
ForEach(Array(openChannels.enumerated()), id: \.element.channelId) { index, channel in
113+
let labelIndex = openChannels.count - index
112114
Button {
113115
navigation.navigate(.connectionDetail(channelId: channel.channelIdString))
114116
} label: {
115117
VStack(spacing: 0) {
116118
HStack {
117-
SubtitleText("\(t("lightning__connection")) \(index + 1)")
119+
SubtitleText("\(t("lightning__connection")) \(labelIndex)")
118120
Spacer()
119121
Image("chevron")
120122
.resizable()
@@ -147,12 +149,13 @@ struct LightningConnectionsView: View {
147149
.padding(.top, 16)
148150

149151
ForEach(Array(closedChannels.enumerated()), id: \.element.channelId) { index, channel in
152+
let labelIndex = closedChannels.count - index
150153
Button {
151154
navigation.navigate(.connectionDetail(channelId: channel.channelIdString))
152155
} label: {
153156
VStack(spacing: 0) {
154157
HStack {
155-
SubtitleText("\(t("lightning__connection")) \(index + 1)")
158+
SubtitleText("\(t("lightning__connection")) \(labelIndex)")
156159
Spacer()
157160
Image("chevron")
158161
.resizable()

0 commit comments

Comments
 (0)