mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-23 11:36:13 +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;
|
||||
}
|
||||
|
||||
async get(key: StoreKey): Promise<Uint8Array> {
|
||||
async get(key: StoreKey): Promise<Uint8Array | null> {
|
||||
return await invoke<number[]>("plugin:stronghold|get_store_record", {
|
||||
snapshotPath: this.path,
|
||||
client: this.client,
|
||||
key: toBytesDto(key),
|
||||
}).then((v) => Uint8Array.from(v));
|
||||
}).then((v) => {
|
||||
if (v) {
|
||||
return Uint8Array.from(v);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async insert(
|
||||
|
||||
Reference in New Issue
Block a user