Skip to content

Commit

Permalink
fix: sanitise ssrRef data
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed May 10, 2020
1 parent 2ef608b commit d86fdb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ssr-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ export const ssrRef = <T>(value: T | (() => T), key?: string): Ref<T> => {
return Reflect.get(target, prop)
},
set(obj, prop, val) {
data[key] = _ref.value
data[key] = JSON.parse(JSON.stringify(_ref.value))
return Reflect.set(obj, prop, val)
},
})

const proxy = computed({
get: () => (isProxyable(_ref.value) ? getProxy(_ref.value) : _ref.value),
set: v => {
data[key] = v
data[key] = JSON.parse(JSON.stringify(v))
_ref.value = v
},
})
Expand Down

1 comment on commit d86fdb2

@vercel
Copy link

@vercel vercel bot commented on d86fdb2 May 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.