philhk / Vencord

The cutest Discord client mod
GNU General Public License v3.0
56 stars 23 forks source link

fix: object can not be cloned error on latest version of Vencord #20

Closed Aztup closed 6 months ago

Aztup commented 6 months ago

This fix the error "Object can not be cloned" on the latest version of Vencord without modifying the Settings.ts file of Vencord which should allow this fork to stay up to date on the latest version of Vencord.

philhk commented 6 months ago

Hey, I really appreciate your effort in trying to find a proper solution for this problem! Actually, I can't understand my own code that well anymore, so please excuse that. Your approach seems to filter out the settings and also uses a proxy to act as another layer? I like the idea of a proxy, but filtering the settings like that defeats the whole purpose of abstracting the store logic. I think a better approach would be either to stick with the JSON.parse approach or instead of that, parse all settings and exclude functions. Also, I've never worked with proxies before, so I don't think I'm capable of reviewing this properly and I want to avoid breaking the plugin. Vencord stores were never designed to have functions, so doing it like this wasn't the best decision.