@vacantthinker/firefox-addon-framework-easy 2026.527.2043 → 2026.527.2111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vacantthinker/firefox-addon-framework-easy",
3
- "version": "2026.0527.2043",
3
+ "version": "2026.0527.2111",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -1,26 +1,23 @@
1
1
  import {stoOpGet, stoOpSet} from './opStorage.js';
2
2
 
3
3
  /**
4
- * this function connect with generateHtmlByUserSettings()
5
4
  *
6
- * @param userSettings{{}}
5
+ * @param userSettings{Object}
7
6
  * @returns {Promise<void>}
8
7
  */
9
8
  export async function serviceInitUserSettings(userSettings) {
10
- for (const k of Object.keys(userSettings)) {
11
- let v = userSettings[k];
12
- let options = v.options;
13
- let selected = v.selected;
14
-
15
- // todo check if has oldvalue donothing, else set k and v
16
- let oldValue = await stoOpGet(k);
17
- if (oldValue) {
18
- }
19
- else {
20
- await stoOpSet(k, selected);
21
- }
22
-
23
- }
9
+ const initPromises = Object.entries(userSettings).
10
+ map(async ([key, setting]) => {
11
+ const oldValue = await stoOpGet(key);
12
+
13
+ // FIX: Check strictly for null or undefined.
14
+ // This allows `false` and `0` to be recognized as valid saved values.
15
+ if (oldValue === null || oldValue === undefined) {
16
+ await stoOpSet(key, setting.selected);
17
+ }
18
+ });
19
+
20
+ await Promise.all(initPromises);
24
21
  }
25
22
 
26
23
  /**