Skip to content

Commit

Permalink
Invoke cancelHighlight earlier (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanzhong authored Nov 17, 2024
1 parent 7460876 commit 1437808
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions LunarBarMac/Sources/Views/DateGridView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ private extension DateGridView {

@MainActor
func reloadData(allDates: [Date], events: [EKCalendarItem] = [], diffable: Bool = true) {
cancelHighlight()
Logger.log(.info, "Reloading dateGridView: \(allDates.count) items")

var snapshot = NSDiffableDataSourceSnapshot<Section, Model>()
snapshot.appendSections([Section.default])

Expand All @@ -174,9 +177,6 @@ private extension DateGridView {
let animated = diffable && !AppPreferences.Accessibility.reduceMotion
dataSource?.apply(snapshot, animatingDifferences: animated)

cancelHighlight()
Logger.log(.info, "Reloaded dateGridView: \(allDates.count) items")

// Force update of certain properties that are not part of the diffable model
if !diffable {
visibleCells.forEach {
Expand Down

0 comments on commit 1437808

Please sign in to comment.