Skip to content

Commit

Permalink
Fix brave#781: Remove swipe-to-delete in Sync settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
iccub committed Jan 23, 2019
1 parent b06ea37 commit d765537
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions Client/Frontend/Sync/SyncSettingsTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,6 @@ class SyncSettingsTableViewController: UITableViewController {
return nil
}
}

override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
if indexPath.section != Sections.deviceList.rawValue { return false }

// First cell is our own device, we don't want to allow swipe to delete it.
return indexPath.row != 0
}

override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {

guard let deviceToDelete = frc?.object(at: indexPath), editingStyle == .delete else { return }
deviceToDelete.remove()
}
}

// MARK: - NSFetchedResultsControllerDelegate
Expand Down

0 comments on commit d765537

Please sign in to comment.