Manually merge stored and default settings
ClosedPublic

Authored by broulik on Apr 13 2020, 12:31 PM.

Details

Summary

One can pass a default Object to storage.get() which will be used for keys that don't exist.
However, it doesn't do that recursively, so when we add a new settings key for a specific module, like the addToRecentDocuments it will not be present for anyone who already touched the extension settings.

Test Plan
  • Added a new key to an existing module setting, got the key show up. The other settings seem unaffected.

Diff Detail

Repository
R856 Plasma Browser Integration
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Apr 13 2020, 12:31 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 13 2020, 12:31 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Apr 13 2020, 12:31 PM
fvogt accepted this revision.Apr 13 2020, 12:54 PM

Just have to make sure not to add anything to DEFAULT_EXTENSION_SETTINGS.mpris.websiteSettings now. Previously that would've been ignored.

extension/utils.js
39

Why not if/else?

This revision is now accepted and ready to land.Apr 13 2020, 12:54 PM
broulik updated this revision to Diff 80006.Apr 13 2020, 1:01 PM
  • if/else
fvogt accepted this revision.Apr 13 2020, 1:06 PM
fvogt added inline comments.
extension/utils.js
39

I'd invert the condition

This revision was automatically updated to reflect the committed changes.