     deinit {
         NotificationCenter.default.removeObserver(self)
     }
+
+    private func dismissCollapsedCards() {
+        guard let contentGroups = fetchedResultsController.fetchedObjects else {
+            return
+        }
+        for contentGroup in contentGroups {
+            guard contentGroup.undoType != .none else {
+                continue
+            }
+            if contentGroup.undoType == .contentGroup {
+                contentGroup.markDismissed()
+            }
+            contentGroup.isVisible = false
+            contentGroup.undoType = .none
+        }
+        save()
+    }
     
     public var wantsCustomSearchTransition: Bool {
         return true

    
    override func viewDidDisappear(_ animated: Bool) {
        super.viewDidDisappear(animated)
        stopMonitoringReachability()
        collectionViewUpdater.isGranularUpdatingEnabled = false
    }

        }
        group.undoType = .none
        wantsDeleteInsertOnNexItemtUpdate = true
        if let indexPath = fetchedResultsController.indexPath(forObject: group) {
            indexPathsForCollapsedCellsThatCanReappear.remove(indexPath)
        }
        save()
    }
    
