diff --git a/services/web/frontend/js/shared/hooks/use-scope-value-setter-only.ts b/services/web/frontend/js/shared/hooks/use-scope-value-setter-only.ts index 402d47165c..27564a1d6a 100644 --- a/services/web/frontend/js/shared/hooks/use-scope-value-setter-only.ts +++ b/services/web/frontend/js/shared/hooks/use-scope-value-setter-only.ts @@ -19,7 +19,7 @@ export default function useScopeValueSetterOnly( path: string, // dot '.' path of a property in the Angular scope. defaultValue?: T ): [T | undefined, Dispatch>] { - const { $scope } = useIdeContext() + const { scopeStore } = useIdeContext() const [value, setValue] = useState(defaultValue) @@ -27,11 +27,11 @@ export default function useScopeValueSetterOnly( (newValue: SetStateAction) => { setValue(val => { const actualNewValue = _.isFunction(newValue) ? newValue(val) : newValue - $scope.$applyAsync(() => _.set($scope, path, actualNewValue)) + scopeStore.set(path, actualNewValue) return actualNewValue }) }, - [path, $scope] + [path, scopeStore] ) return [value, scopeSetter]