Skip to content

Commit

Permalink
fix config polling comparison bug (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-aleksander authored Oct 16, 2024
1 parent d8018b1 commit d3654cd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src-tauri/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,23 @@ pub async fn locations_changed(
.await?
.into_iter()
.map(Location::<NoId>::from)
// ignore route_all_traffic flag as core does not have it
.map(|mut location| {
location.route_all_traffic = false;
location
})
.collect();
let db_locations: HashSet<Location<NoId>> = HashSet::from_iter(db_locations);
let core_locations: Vec<Location<NoId>> = device_config
.configs
.iter()
.map(|config| device_config_to_location(config.clone(), instance.id))
.map(Location::<NoId>::from)
// just to make sure we are really on the same page
.map(|mut location| {
location.route_all_traffic = false;
location
})
.collect();
let core_locations: HashSet<Location<NoId>> = HashSet::from_iter(core_locations);

Expand Down

0 comments on commit d3654cd

Please sign in to comment.