.column(repository::Column::LocalPath)
.into_tuple::<(LocalStorageSetting, bool, Option<String>)>()
.one(&bhandle.backend.db).await;
- let col = result.ok().flatten().unwrap();
+ let storage = if let Ok(okres) = result && let Some(storage) = okres {
+ storage
+ } else {
+ // should not happen
+ callback(SaveNoteResult::Error(DbErr::Custom("Cannot get storage settings".to_string())));
+ return;
+ };
- if col.0 == LocalStorageSetting::FileSystem || (col.0 == LocalStorageSetting::Default && col.1) {
- if col.2.is_none() {
+ if storage.0 == LocalStorageSetting::FileSystem || (storage.0 == LocalStorageSetting::Default && storage.1) {
+ if storage.2.is_none() {
println!("Warning: collection is configured to use local storage, but there is no local storage path configured in the repository");
}
- col.2
+ storage.2
} else {
None
}