@@ -154,30 +154,44 @@ class CustomListViewController: UIViewController {
154
154
} catch {
155
155
validationErrors. insert ( . name)
156
156
dataSourceConfiguration? . set ( validationErrors: validationErrors)
157
+ showSaveErrorAlert ( )
157
158
}
158
159
}
159
160
160
161
private func onDelete( ) {
161
- // TODO: Show error dialog.
162
- delegate? . customListDidDelete ( )
162
+ showDeleteAlert ( )
163
163
}
164
164
165
- private func showSaveErrorAlert ( ) {
165
+ private func showDeleteAlert ( ) {
166
166
let presentation = AlertPresentation (
167
- id: " api-custom-lists-save -list-alert " ,
167
+ id: " api-custom-lists-delete -list-alert " ,
168
168
icon: . alert,
169
169
message: NSLocalizedString (
170
- " CUSTOM_LISTS_SAVE_ERROR_PROMPT " ,
170
+ " CUSTOM_LISTS_DELETE_PROMPT " ,
171
171
tableName: " APIAccess " ,
172
- value: " List name is already taken. " ,
172
+ value: " Delete \( subject . value . name ) ? " ,
173
173
comment: " "
174
174
) ,
175
175
buttons: [
176
176
AlertAction (
177
177
title: NSLocalizedString (
178
- " CUSTOM_LISTS_OK_BUTTON " ,
178
+ " CUSTOM_LISTS_DELETE_BUTTON " ,
179
179
tableName: " APIAccess " ,
180
- value: " Got it! " ,
180
+ value: " Delete " ,
181
+ comment: " "
182
+ ) ,
183
+ style: . destructive,
184
+ handler: {
185
+ self . interactor. deleteCustomList ( id: self . subject. value. id)
186
+ self . dismiss ( animated: true )
187
+ self . delegate? . customListDidDelete ( )
188
+ }
189
+ ) ,
190
+ AlertAction (
191
+ title: NSLocalizedString (
192
+ " CUSTOM_LISTS_CANCEL_BUTTON " ,
193
+ tableName: " APIAccess " ,
194
+ value: " Cancel " ,
181
195
comment: " "
182
196
) ,
183
197
style: . default
0 commit comments