             })
 
         alert.addAction(cancelAction)
-        if let categoryAction = categoryAction {
-            alert.addAction(categoryAction)
+        if let renameAction = renameAction {
+            alert.addAction(renameAction)
         }
         alert.view.tintColor = UIColor.piwigoColorOrange()
         if #available(iOS 13.0, *) {

                cell?.hideSwipe(animated: true)
            })

        categoryAction = UIAlertAction(
            title: NSLocalizedString("renameCategory_button", comment: "Rename"),
            style: .default, handler: { [self] action in
                // Rename album if possible

{
    func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
        // Disable Add/Delete Category action
        renameAction?.isEnabled = false
        deleteAction?.isEnabled = false
        return true
    }
