mirror of
https://github.com/uqbar-dao/nectar.git
synced 2025-01-03 14:17:20 +03:00
fix: don't open browser window on boot if running in detached
mode
This commit is contained in:
parent
9918896139
commit
c8cadf23fc
@ -78,7 +78,7 @@ async fn main() {
|
||||
let password = matches.get_one::<String>("password");
|
||||
|
||||
// detached determines whether terminal is interactive
|
||||
let is_detached = *matches.get_one::<bool>("detached").unwrap();
|
||||
let detached = *matches.get_one::<bool>("detached").unwrap();
|
||||
|
||||
#[cfg(feature = "simulation-mode")]
|
||||
let (fake_node_name, fakechain_port) = (
|
||||
@ -420,7 +420,7 @@ async fn main() {
|
||||
kernel_debug_message_sender,
|
||||
print_sender.clone(),
|
||||
print_receiver,
|
||||
is_detached,
|
||||
detached,
|
||||
verbose_mode,
|
||||
) => {
|
||||
match quit {
|
||||
@ -730,7 +730,8 @@ async fn serve_register_fe(
|
||||
(tcp_networking.0.as_ref(), tcp_networking.1),
|
||||
http_server_port,
|
||||
disk_keyfile,
|
||||
maybe_rpc) => {
|
||||
maybe_rpc,
|
||||
detached) => {
|
||||
panic!("registration failed")
|
||||
}
|
||||
Some((our, decoded_keyfile, encoded_keyfile)) = rx.recv() => {
|
||||
|
@ -41,6 +41,7 @@ pub async fn register(
|
||||
http_port: u16,
|
||||
keyfile: Option<Vec<u8>>,
|
||||
maybe_rpc: Option<String>,
|
||||
detached: bool,
|
||||
) {
|
||||
// Networking info is generated and passed to the UI, but not used until confirmed
|
||||
let (public_key, serialized_networking_keypair) = keygen::generate_networking_key();
|
||||
@ -211,7 +212,9 @@ pub async fn register(
|
||||
.or(api)
|
||||
.with(warp::reply::with::headers(headers));
|
||||
|
||||
let _ = open::that(format!("http://localhost:{}/", http_port));
|
||||
if !detached {
|
||||
let _ = open::that(format!("http://localhost:{}/", http_port));
|
||||
}
|
||||
warp::serve(routes)
|
||||
.bind_with_graceful_shutdown(([0, 0, 0, 0], http_port), async {
|
||||
kill_rx.await.ok();
|
||||
|
Loading…
Reference in New Issue
Block a user