Skip to content

Commit

Permalink
fix: show data when filter disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
lawvs committed Aug 4, 2024
1 parent 834723b commit 0afe438
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/data-types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as Y from "yjs";
import { Badge } from "./components/ui/badge";
import { toast } from "./components/ui/use-toast";
import { removeMismatchedValues } from "./filter-set";
import { useConfig, useFilterSet } from "./state";
import { useConfig, useFilterSet, useIsFilterEnable } from "./state";
import { getYTypeName, isYShape, parseYShape } from "./y-shape";

const TypeLabel = ({ value }: { value: unknown }) => {
Expand Down Expand Up @@ -85,7 +85,8 @@ const YTypeComponent: ComponentType<DataItemProps<any>> = ({
const StrComponent = stringType.Component!;
const ObjComponent = objectType.Component!;
const [config] = useConfig();
const [filterSet] = useFilterSet();
const filterSet = useFilterSet();
const isFilterEnable = useIsFilterEnable();

if (!config.parseYDoc) {
if (typeof value === "string") {
Expand Down Expand Up @@ -116,7 +117,9 @@ const YTypeComponent: ComponentType<DataItemProps<any>> = ({
);
}

const filteredValue = removeMismatchedValues(parsedValue, filterSet);
const filteredValue = isFilterEnable
? removeMismatchedValues(parsedValue, filterSet)
: parsedValue;
if (!filteredValue) {
return null;
}
Expand Down

0 comments on commit 0afe438

Please sign in to comment.