Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix empty filter
  • Loading branch information
BrunoQuaresma committed Jun 1, 2023
commit c1d015b002247be571434c7a418c6fcd34ddd4ef
2 changes: 1 addition & 1 deletion site/src/pages/WorkspacesPage/WorkspacesPageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const WorkspacesPageView: FC<
workspaces={workspaces}
isUsingFilter={
filterProps.filter.query !== "" &&
filterProps.filter.query !== "owner:me"
filterProps.filter.query !== workspaceFilterQuery.me
}
onUpdateWorkspace={onUpdateWorkspace}
error={error}
Expand Down
3 changes: 2 additions & 1 deletion site/src/pages/WorkspacesPage/filter/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
BaseOption,
} from "./options"
import debounce from "just-debounce-it"
import { workspaceFilterQuery } from "utils/filters"

export type FilterValues = {
owner?: string // User["username"]
Expand All @@ -50,7 +51,7 @@ export const useFilter = ({
onUpdate?: () => void
}) => {
const [searchParams, setSearchParams] = searchParamsResult
const query = searchParams.get("filter") ?? "owner:me"
const query = searchParams.get("filter") ?? workspaceFilterQuery.me
const values = parseFilterQuery(query)

const update = (values: string | FilterValues) => {
Expand Down