Skip to content

Commit

Permalink
fix: only set mode if it's missing
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks committed Dec 29, 2023
1 parent ab601f4 commit fc3ebca
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions server/api/src/public/v1/calculate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,16 @@ async fn bootstrap(
if !feat.contains_property("__name") && !instance.is_empty() {
feat.set_property("__name", instance.clone());
}
feat.set_property(
"__mode",
if conn.scanner_type == ScannerType::Unown {
"circle_pokemon"
} else {
"circle_smart_pokemon"
},
);
if !feat.contains_property("__mode") {
feat.set_property(
"__mode",
if conn.scanner_type == ScannerType::Unown {
"circle_pokemon"
} else {
"circle_smart_pokemon"
},
);
}
if save_to_db {
route::Query::upsert_from_geometry(&conn.koji, GeoFormats::Feature(feat.clone()))
.await
Expand Down

0 comments on commit fc3ebca

Please sign in to comment.