-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
TextReplace: Use settings.json for storing rules instead of DataStore API #1767
Conversation
…rd reload is required)
…ly import rules on startup (or Discord reload)
…y place where the rules are being stored to and loaded from
…not being in the list though)
use settings.store instead of vencord.settings.plugins |
src/plugins/textReplace/index.tsx
Outdated
regexRules = await DataStore.get(REGEX_RULES_KEY) ?? makeEmptyRuleArray(); | ||
getRulesFromSettingsJson(); | ||
if (!("rules" in Vencord.Settings.plugins[PLUGIN_NAME])) { | ||
// If the "rules" key doesn't exist in the settings.json yet, create it at startup so users can directly start defining their rules in the settings.json using a blank template. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would have to be changed relatively soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, what exactly are you referring to? And does it still apply to the current state of the code (I pushed changes)?
Oops, will fix that, thanks for letting me know! |
also
|
optimally this rewrite should wait on #696 |
also this is already implimented in #696 by the looks of it.
|
…tead of Vencord.settings.plugins... (that was stupid, sorry)
I was told that my idea was suggested before and got declined: #540 (comment) The Discord user vending.machine also made me aware of the drawbacks:
|
The changes of this PR change the way the existing TextReplace plugin stores the rules (find, replace). It uses the settings.store (aka. the settings.json file in the AppData directory) instead of Vencord's DataStore API (aka. the IndexedDB of Chromium).
Using the settings.json would have a few benefits imo:
I'm not aware of potential drawbacks. Let me know what you think about it.