Skip to content

Commit aecca40

Browse files
committed
init storage
1 parent 2ff4c2e commit aecca40

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

toolkit/components/felt/FeltStorage.sys.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ ChromeUtils.defineESModuleGetters(lazy, {
1212
* Storage helper for reading and writing felt-related profile data to felt.json
1313
*/
1414
export const FeltStorage = {
15+
_initialized: false,
16+
1517
/**
1618
* Absolute path to the felt.json file in the current profile.
1719
*
@@ -23,10 +25,11 @@ export const FeltStorage = {
2325
),
2426

2527
async init() {
26-
if (!(this._feltStorage instanceof lazy.JSONFile)) {
28+
if (!this._initialized) {
2729
this._feltStorage = new lazy.JSONFile({
2830
path: this.FELT_FILE_PATH,
2931
});
32+
this._initialized = true;
3033
}
3134
await this._feltStorage.load();
3235
},
@@ -95,5 +98,6 @@ export const FeltStorage = {
9598

9699
async uninit() {
97100
this._feltStorage = {};
101+
this._initialized = false;
98102
},
99103
};

0 commit comments

Comments
 (0)