mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-22 21:30:44 +02:00
fix(stronghold): return null if there is no record (#129)
* [stronghold] return null if there is no record * Return value * return statement * prettier * fix function signature * fix if condition * simplify condition --------- Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
This commit is contained in:
@@ -293,12 +293,18 @@ export class Store {
|
|||||||
this.client = client;
|
this.client = client;
|
||||||
}
|
}
|
||||||
|
|
||||||
async get(key: StoreKey): Promise<Uint8Array> {
|
async get(key: StoreKey): Promise<Uint8Array | null> {
|
||||||
return await invoke<number[]>("plugin:stronghold|get_store_record", {
|
return await invoke<number[]>("plugin:stronghold|get_store_record", {
|
||||||
snapshotPath: this.path,
|
snapshotPath: this.path,
|
||||||
client: this.client,
|
client: this.client,
|
||||||
key: toBytesDto(key),
|
key: toBytesDto(key),
|
||||||
}).then((v) => Uint8Array.from(v));
|
}).then((v) => {
|
||||||
|
if (v) {
|
||||||
|
return Uint8Array.from(v);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async insert(
|
async insert(
|
||||||
|
|||||||
Reference in New Issue
Block a user