Revert "Add get-or-create-store"

This reverts commit 7ffd769240.
This commit is contained in:
Tony
2024-10-03 13:53:59 +08:00
parent 7ffd769240
commit 3acf66ee57
7 changed files with 3 additions and 96 deletions
-14
View File
@@ -77,19 +77,6 @@ async fn get_store<R: Runtime>(app: AppHandle<R>, path: PathBuf) -> Option<Resou
stores.get(&path).copied()
}
#[tauri::command]
async fn get_or_create_store<R: Runtime>(
app: AppHandle<R>,
path: PathBuf,
auto_save: Option<AutoSave>,
) -> Result<ResourceId> {
if let Some(rid) = get_store(app.clone(), path.clone()).await {
Ok(rid)
} else {
create_store(app, path, auto_save).await
}
}
#[tauri::command]
async fn set<R: Runtime>(
app: AppHandle<R>,
@@ -245,7 +232,6 @@ impl<R: Runtime> Builder<R> {
.invoke_handler(tauri::generate_handler![
create_store,
get_store,
get_or_create_store,
set,
get,
has,