Skip to content

Commit 7d73684

Browse files
committed
fixes
1 parent 3b7e609 commit 7d73684

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

dashi/src/lib/actions/handleHostStoreChange.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import type {
99
} from "@/lib/types/model/callback";
1010
import type { Input } from "@/lib/types/model/channel";
1111
import { getInputValues } from "@/lib/actions/helpers/getInputValues";
12-
import { getValue, type ObjPath } from "@/lib/utils/objPath";
12+
import { getValue, type ObjPath, toObjPath } from "@/lib/utils/objPath";
1313
import { invokeCallbacks } from "@/lib/actions/helpers/invokeCallbacks";
14-
import type { ContributionState } from "@/lib";
14+
import type { ContributionState } from "@/lib/types/state/contribution";
1515

1616
/**
1717
* A reference to a property of an input of a callback of a contribution.
@@ -77,7 +77,7 @@ function _getHostStorePropertyRefs(): PropertyRef[] {
7777
contribIndex,
7878
callbackIndex,
7979
inputIndex,
80-
propertyPath: input.property!.split("."),
80+
propertyPath: toObjPath(input.property!),
8181
});
8282
}
8383
}),
@@ -93,7 +93,7 @@ function hasPropertyChanged<S extends object = object>(
9393
currState: S,
9494
prevState: S,
9595
): boolean {
96-
const currValue = propertyPath(currState, propertyPath);
97-
const prevValue = propertyPath(prevState, propertyPath);
96+
const currValue = getValue(currState, propertyPath);
97+
const prevValue = getValue(prevState, propertyPath);
9898
return !Object.is(currValue, prevValue);
9999
}

dashi/src/lib/utils/objPath.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function _setValue<S extends object>(
6262
return obj;
6363
}
6464

65-
function toObjPath(property: ObjPath | string): ObjPath {
65+
export function toObjPath(property: ObjPath | string): ObjPath {
6666
if (Array.isArray(property)) {
6767
return property as ObjPath;
6868
}

0 commit comments

Comments
 (0)