BDPluginLibrary icon indicating copy to clipboard operation
BDPluginLibrary copied to clipboard

Utilities.loadData

Open yofukashino opened this issue 2 years ago • 1 comments

the saved data is [] and the defaultData is ["ctrl","f"] , Utilities.loadData loads defaultData intead of the saved data

yofukashino avatar Aug 05 '22 19:08 yofukashino

new issue, i tried using a single object to counter this issue, the saved data is

{
    "currentVersionInfo": {
        "version": "1.6.1",
        "hasShownChangelog": true
    },
    "settings": {
        "statusPicker": true,
        "userPanel": true,
        "playAudio": true,
        "showToast": true,
        "keybind": []
    }
}

and the default data is

 const defaultSettings = {
          statusPicker: true,
          userPanel: true,
          playAudio: true,
          showToast: true,
          keybind: ["ctrl", "shift", "g"]
        }

by using

Utilities.loadData(
              config.info.name,
              "settings",
              defaultSettings
            );

to load settings it loads

{
          statusPicker: true,
          userPanel: true,
          playAudio: true,
          showToast: true,
          keybind: ["ctrl", "shift", "g"]
       }

but the keybind propety should be empty

yofukashino avatar Sep 07 '22 21:09 yofukashino

Please try with the latest version

zerebos avatar Mar 04 '23 04:03 zerebos