Replies: 1 comment
-
|
And I don’t think flattening all options is a good solution, because then I would need to define an individual storage item for every single leaf node. That quickly becomes redundant and very complex. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It seems that WXT's
storage.defineItemdoesn't support modifying nested properties of an item. For example, I have the following:Then I create a storage item from it:
When using
setValue, I can only assign the entire object at once. The worst part is that the default values are stored as well. What I want is to store only the settings explicitly changed by the user, so that if the defaults change in the future, they will automatically be taken from the fallback. Right now, it seems that the entire object gets saved, even if the user hasn't modified some settings.Ideally, I’d like to be able to do something like:
so that only the changed part is stored:
{ "foo": { "bar": 12 } }and
x.yremains untouched and continues to fall back to the default.Am I using this incorrectly, or is this expected behavior?
Beta Was this translation helpful? Give feedback.
All reactions