     
     @objc fileprivate func toggleEditMode(_ sender: UIBarButtonItem) {
         isEditMode.toggle()
-        configureNavigationBar()
-        configureToolBar(showTrash: true)
     }
     
     private func deleteAll() {
         guard let objects = objects else { return }
-        engine.deleteObjects(objects: objects) {}
+        engine.deleteObjects(objects: objects)
     }
     
     @objc fileprivate func toggleDelete(sender: UIBarButtonItem) {

    
    private func configureBarButtonItems() {
        configureNavigationBar()
        configureToolBar(showTrash: false)
    }
    
    private func configureToolBar(showTrash: Bool) {
        let menu = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: .actionMenu)
        let space = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
        let items: [UIBarButtonItem]
        if showTrash {
            let trash = UIBarButtonItem(barButtonSystemItem: .trash, target: self, action: .actionTrash)
            items = [menu, space, trash]
        } else {

            self.deleteAll()
        }
        let actionDeleteSelected = UIAlertAction(title: "Delete selected", style: .destructive) { [unowned self] _ in
            guard let selectedRows = self.viewRealm.tableView.indexPathsForSelectedRows,
                let objects = self.objects, objects.isNonEmpty else { return }
            let results = selectedRows.map { objects[$0.row] }
            self.engine.deleteObjects(objects: results)
        }
        alertController.addAction(actionDelete)
        alertController.addAction(actionDeleteSelected)
