mirror of
https://code.gri.mw/GUI/grim.git
synced 2026-07-12 01:38:54 +00:00
node: restart on api/p2p ports change
This commit is contained in:
@@ -318,6 +318,10 @@ impl NodeSetup {
|
||||
// Save port at config if it's available.
|
||||
NodeConfig::save_api_address(&api_ip, &self.api_port_edit);
|
||||
|
||||
if Node::is_running() {
|
||||
Node::restart();
|
||||
}
|
||||
|
||||
self.is_api_port_available = true;
|
||||
cb.hide_keyboard();
|
||||
modal.close();
|
||||
|
||||
@@ -22,7 +22,7 @@ use crate::gui::platform::PlatformCallbacks;
|
||||
use crate::gui::views::{Modal, View};
|
||||
use crate::gui::views::network::settings::NetworkSettings;
|
||||
use crate::gui::views::types::{ModalContainer, ModalPosition, TextEditOptions};
|
||||
use crate::node::{NodeConfig, PeersConfig};
|
||||
use crate::node::{Node, NodeConfig, PeersConfig};
|
||||
|
||||
/// Type of peer.
|
||||
#[derive(Eq, PartialEq)]
|
||||
@@ -310,6 +310,10 @@ impl P2PSetup {
|
||||
if available {
|
||||
NodeConfig::save_p2p_port(self.port_edit.parse::<u16>().unwrap());
|
||||
|
||||
if Node::is_running() {
|
||||
Node::restart();
|
||||
}
|
||||
|
||||
self.is_port_available = true;
|
||||
cb.hide_keyboard();
|
||||
modal.close();
|
||||
|
||||
Reference in New Issue
Block a user