[Fix] Connection Management
This commit is contained in:
parent
9e9e3597da
commit
3f2ac18333
122 changed files with 19970 additions and 5263 deletions
|
|
@ -2,7 +2,7 @@ use std::sync::Arc;
|
|||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
use iota_cli::screens::terms_checker::{TermsCheckerScreen, UserChoice};
|
||||
use iota_cli::ui::UI;
|
||||
use iota_cli::ui::UiHandle;
|
||||
use iota_terms::{Doc, LegalDocument, TermsType as Type, get_current_docs};
|
||||
use iota_util::file_util::{load_file, save_file};
|
||||
use tokio::sync::oneshot;
|
||||
|
|
@ -13,7 +13,7 @@ pub struct ConsentCheck {
|
|||
pub documents: [LegalDocument; 3],
|
||||
}
|
||||
|
||||
pub async fn check(ui: Arc<UI>) -> Result<ConsentCheck, String> {
|
||||
pub async fn check(ui: Arc<UiHandle>) -> Result<ConsentCheck, String> {
|
||||
let mut state = ConsentState::load_state();
|
||||
|
||||
let documents = ensure_initial_consent(ui.clone(), &mut state).await?;
|
||||
|
|
@ -49,7 +49,7 @@ pub fn non_interactive_consent() -> NonInteractiveConsent {
|
|||
}
|
||||
|
||||
async fn ensure_initial_consent(
|
||||
ui: Arc<UI>,
|
||||
ui: Arc<UiHandle>,
|
||||
state: &mut ConsentState,
|
||||
) -> Result<[LegalDocument; 3], String> {
|
||||
let (current_eula, current_tos, current_privacy) = get_current_docs().await.ok_or_else(|| {
|
||||
|
|
@ -99,7 +99,7 @@ async fn ensure_initial_consent(
|
|||
}
|
||||
}
|
||||
/*
|
||||
async fn ensure_updates(ui: Arc<UI>, state: &mut ConsentState) -> Result<(), String> {
|
||||
async fn ensure_updates(ui: Arc<UiHandle>, state: &mut ConsentState) -> Result<(), String> {
|
||||
let Some((eula_update, tos_update, privacy_update)) = get_updates().await else {
|
||||
return Ok(());
|
||||
};
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ async fn main() {
|
|||
let ipc = IpcClient::connect(socket)
|
||||
.await
|
||||
.expect("iota-daemon must be running before starting iota-core");
|
||||
let session = start_tui(ipc).expect("interactive terminal initialization failed");
|
||||
let session = start_tui(ipc.clone()).expect("interactive terminal initialization failed");
|
||||
let ui = session.ui();
|
||||
|
||||
let consent = match consent_state::check(ui.clone()).await {
|
||||
|
|
@ -83,7 +83,7 @@ async fn main() {
|
|||
check_update();
|
||||
iota_state::setup(&state);
|
||||
|
||||
let main_screen = MainScreen::new(ui.clone()).await;
|
||||
let main_screen = MainScreen::new(ipc);
|
||||
ui.set_screen(Box::new(main_screen)).await;
|
||||
|
||||
// LANGUAGE PACK
|
||||
|
|
|
|||
Loading…
Reference in a new issue