mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
fix(core): fix all docs filters internal state reset (#12412)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved filter behavior by resetting filter state when editing or switching collections, ensuring filters are cleared appropriately. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -231,6 +231,7 @@ export const AllPage = () => {
|
||||
}
|
||||
setSelectedCollectionId(collectionId);
|
||||
setTempFilters(collection.info$.value.rules.filters);
|
||||
setTempFiltersInitial(null);
|
||||
},
|
||||
[collectionService]
|
||||
);
|
||||
@@ -320,6 +321,8 @@ export const AllPage = () => {
|
||||
{tempFilters !== null && (
|
||||
<div className={styles.filterArea}>
|
||||
<Filters
|
||||
// When the selected collection changes, the filters internal state should be reset
|
||||
key={selectedCollectionId ?? 'all'}
|
||||
className={styles.filters}
|
||||
filters={tempFilters}
|
||||
onChange={handleFilterChange}
|
||||
|
||||
Reference in New Issue
Block a user