Skip to content

Commit 495aea9

Browse files
committed
fix: server option page crashing
1 parent d89a53d commit 495aea9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

iOS/Views/Settings/Server Options/ServerOptionsViewController.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ extension ServerOptionsViewController {
158158

159159
private func updateCells() {
160160
if Preferences.onlinePath != Preferences.defaultInstallPath {
161-
tableData[0].insert(String.localized("SETTINGS_VIEW_CONTROLLER_CELL_RESET_CONFIGURATION"), at: 2)
161+
tableData[1].insert(String.localized("SETTINGS_VIEW_CONTROLLER_CELL_RESET_CONFIGURATION"), at: 2)
162162
}
163163
Preferences.installPathChangedCallback = { [weak self] newInstallPath in
164164
self?.handleInstallPathChange(newInstallPath)
@@ -167,14 +167,14 @@ extension ServerOptionsViewController {
167167

168168
private func handleInstallPathChange(_ newInstallPath: String?) {
169169
if newInstallPath != Preferences.defaultInstallPath {
170-
tableData[0].insert(String.localized("SETTINGS_VIEW_CONTROLLER_CELL_RESET_CONFIGURATION"), at: 2)
170+
tableData[1].insert(String.localized("SETTINGS_VIEW_CONTROLLER_CELL_RESET_CONFIGURATION"), at: 2)
171171
} else {
172-
if let index = tableData[0].firstIndex(of: String.localized("SETTINGS_VIEW_CONTROLLER_CELL_RESET_CONFIGURATION")) {
173-
tableData[0].remove(at: index)
172+
if let index = tableData[1].firstIndex(of: String.localized("SETTINGS_VIEW_CONTROLLER_CELL_RESET_CONFIGURATION")) {
173+
tableData[1].remove(at: index)
174174
}
175175
}
176176

177-
tableView.reloadSections(IndexSet(integer: 0), with: .automatic)
177+
tableView.reloadSections(IndexSet(integer: 1), with: .automatic)
178178
}
179179
}
180180

0 commit comments

Comments
 (0)