mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-02 15:45:31 +02:00
Use undefined for empty value in get
This commit is contained in:
@@ -131,9 +131,11 @@ async fn get<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
rid: ResourceId,
|
||||
key: String,
|
||||
) -> Result<Option<JsonValue>> {
|
||||
) -> Result<(Option<JsonValue>, bool)> {
|
||||
let store = app.resources_table().get::<Store<R>>(rid)?;
|
||||
Ok(store.get(key))
|
||||
let value = store.get(key);
|
||||
let exists = value.is_some();
|
||||
Ok((value, exists))
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
Reference in New Issue
Block a user