Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fix: prevent crashes on history deletion - fixes CLIQZ-IOS-1655 (#455)

  • Loading branch information
chrmod committed Aug 23, 2019
1 parent 6e4bf80 commit e3e5a99bd25f4cf39f206d6f4278e7464accb4f1
Showing with 6 additions and 5 deletions.
  1. +6 −5 Client/Frontend/Home/HistoryPanel.swift
@@ -225,18 +225,19 @@ class HistoryPanel: SiteTableViewController, HomePanel {
guard let site = siteForIndexPath(indexPath) else {
return
}
profile.history.removeHistoryForURL(site.url).uponQueue(.main) { result in }
/* Cliqz: system is expecting tableview to perform delete operation with in the same RunLoop, that's why we moved the deletion out of asynchronous callback to fix the animation issue.

profile.history.removeHistoryForURL(site.url).uponQueue(.main) { result in
*/
guard site == self.siteForIndexPath(indexPath) else {
self.reloadData()
return
}

self.tableView.beginUpdates()
self.groupedSites.remove(site)
self.tableView.deleteRows(at: [indexPath], with: .right)
self.tableView.endUpdates()
self.updateEmptyPanelState()
/*
}
*/
}

func pinToTopSites(_ site: Site) {

0 comments on commit e3e5a99

Please sign in to comment.