mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-06 15:57:50 +02:00
try get first
This commit is contained in:
@@ -56,8 +56,8 @@ export class LazyStore implements IStore {
|
||||
|
||||
private get store(): Promise<Store> {
|
||||
if (!this._store) {
|
||||
this._store = createStore(this.path, this.options).catch(
|
||||
async () => (await getStore(this.path))!
|
||||
this._store = getStore(this.path).then(
|
||||
async (store) => store || (await createStore(this.path, this.options))
|
||||
)
|
||||
}
|
||||
return this._store
|
||||
|
||||
Reference in New Issue
Block a user