fix(lib/storage): read options.load and act in Storage directly
This commit is contained in:
parent
138b0dc651
commit
69fff07c1f
1 changed files with 2 additions and 4 deletions
|
|
@ -1,5 +1,3 @@
|
|||
// TODO(storage): Implement using NativeModules interop instead
|
||||
|
||||
import { FileModule } from '@revenge-mod/discord/native'
|
||||
import { getErrorStack } from '@revenge-mod/utils/error'
|
||||
import { mergeDeep } from '@revenge-mod/utils/object'
|
||||
|
|
@ -73,6 +71,8 @@ export function Storage<T extends AnyObject>(
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (options?.load) this.get()
|
||||
}
|
||||
|
||||
// React is only initialized right before the init stage, so this is a dummy method
|
||||
|
|
@ -94,8 +94,6 @@ export function getStorage<T extends AnyObject = AnyObject>(
|
|||
const storage: Storage<T> = Object.create(Storage.prototype)
|
||||
Storage.call(storage, path, options)
|
||||
|
||||
if (options?.load) storage.get()
|
||||
|
||||
return storage
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue