Skip to content

Commit ab9de0c

Browse files
committed
chore: Rename initialValue to fallbackFilter
1 parent 7dd1b4f commit ab9de0c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

site/src/components/Filter/filter.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,19 @@ type FilterValues = Record<string, string | undefined>;
3636

3737
type UseFilterConfig = {
3838
/**
39-
* The fallback value to use in the event that no filter params can be used.
40-
* This value is allowed to change on re-renders.
39+
* The fallback value to use in the event that no filter params can be parsed
40+
* from the search params object. This value is allowed to change on
41+
* re-renders.
4142
*/
42-
initialValue?: string;
43+
fallbackFilter?: string;
4344
searchParamsResult: ReturnType<typeof useSearchParams>;
4445
onUpdate?: (newValue: string) => void;
4546
};
4647

4748
const useFilterParamsKey = "filter";
4849

4950
export const useFilter = ({
50-
initialValue: fallbackFilter = "",
51+
fallbackFilter = "",
5152
searchParamsResult,
5253
onUpdate,
5354
}: UseFilterConfig) => {

site/src/pages/WorkspacesPage/WorkspacesPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ const useWorkspacesFilter = ({
190190
/**
191191
* @todo Rename initialValue to fallbackFilter once changes have been tested
192192
*/
193-
initialValue: localStorageFilter,
193+
fallbackFilter: localStorageFilter,
194194
searchParamsResult,
195195
onUpdate: (newValues) => {
196196
window.localStorage.setItem(workspaceFilterKey, newValues);

0 commit comments

Comments
 (0)