Skip to content

Commit 1715036

Browse files
committed
fix
1 parent 84496f2 commit 1715036

3 files changed

Lines changed: 21 additions & 5 deletions

File tree

src-tauri/src/commands.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,13 @@ pub async fn delete_instance(instance_id: Id, handle: AppHandle) -> Result<(), E
977977
instance_id: instance.uuid.clone(),
978978
})
979979
.await
980-
.unwrap();
980+
.map_err(|err| {
981+
error!(
982+
"Error while deleting service locations from the daemon for instance {}({}): {err}",
983+
instance.name, instance.id,
984+
);
985+
Error::InternalError(err.to_string())
986+
})?;
981987

982988
reload_tray_menu(&handle).await;
983989

src-tauri/src/database/models/location.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ impl Location<Id> {
9393
where
9494
E: SqliteExecutor<'e>,
9595
{
96-
let max_mode = if include_service_locations { 2 } else { 0 }; // 0 to exclude service locations, 2 to include them
96+
let max_mode = if include_service_locations {
97+
ServiceLocationMode::AlwaysOn as i32
98+
} else {
99+
ServiceLocationMode::Disabled as i32
100+
};
97101
query_as!(
98102
Self,
99103
"SELECT id, instance_id, name, address, pubkey, endpoint, allowed_ips, dns, network_id,\
@@ -163,7 +167,11 @@ impl Location<Id> {
163167
where
164168
E: SqliteExecutor<'e>,
165169
{
166-
let max_mode = if include_service_locations { 2 } else { 0 }; // 0 to exclude service locations, 2 to include them
170+
let max_mode = if include_service_locations {
171+
ServiceLocationMode::AlwaysOn as i32
172+
} else {
173+
ServiceLocationMode::Disabled as i32
174+
};
167175
query_as!(
168176
Self,
169177
"SELECT id \"id: _\", instance_id, name, address, pubkey, endpoint, allowed_ips, dns, \

src-tauri/src/service/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ use tracing::{debug, error, info, info_span, Instrument};
5050

5151
use self::config::Config;
5252
use super::VERSION;
53-
use crate::enterprise::service_locations::ServiceLocationError;
5453
#[cfg(windows)]
5554
use crate::enterprise::service_locations::ServiceLocationManager;
56-
use crate::service::proto::{DeleteServiceLocationsRequest, SaveServiceLocationsRequest};
55+
use crate::{
56+
enterprise::service_locations::ServiceLocationError,
57+
service::proto::{DeleteServiceLocationsRequest, SaveServiceLocationsRequest},
58+
};
5759

5860
#[cfg(windows)]
5961
const DAEMON_HTTP_PORT: u16 = 54127;

0 commit comments

Comments
 (0)