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