Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cogburn/fix duplicate config #669

Merged
merged 2 commits into from
Nov 11, 2024
Merged

Conversation

coreyogburn
Copy link
Contributor

Fixes a exception in the duplicate config button handler. Vue 3 uses Proxy objects for reactivity and in most places that doesn't have a negative impact but when duplicating a setting we pass the setting through structuredClone() and that function does not work on proxy objects (you throw DataCloneError). Vue comes with a helper function to unwrap these proxies and give us the plain old object which can be passed successfully to structuredClone().

To help with reactivity, Vue likes to wrap most of it's values as Refs, or proxy objects. In most cases, the proxy/ref can be ignored but structuredClone doesn't work with them (you get a DataCloneError if you try) so we needed to have Vue dereference the object first.
@coreyogburn coreyogburn merged commit 1e23fcc into 2.4/dev Nov 11, 2024
3 checks passed
@coreyogburn coreyogburn deleted the cogburn/fix-duplicate-config branch November 11, 2024 21:06
@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants