override fun handleRemoveRecentHistoryGroup(groupTitle: String) { // We want to update the UI right away in response to user action without waiting for the IO. // First, dispatch actions that will clean up search groups in the two stores that have // metadata-related state. store.dispatch(HistoryMetadataAction.DisbandSearchGroupAction(searchTerm = groupTitle)) appStore.dispatch(AppAction.DisbandSearchGroupAction(searchTerm = groupTitle)) // Then, perform the expensive IO work of removing search groups from storage. scope.launch { storage.deleteHistoryMetadata(groupTitle) } RecentSearches.groupDeleted.record(NoExtras()) }
Removes a [RecentHistoryGroup] with the given title from the homescreen.