mirror of
https://github.com/creating2morrow/neveko.git
synced 2024-12-22 19:49:24 +00:00
patch export info lookup outside of guard
This commit is contained in:
parent
0249d582c5
commit
5486a68f89
2 changed files with 6 additions and 10 deletions
|
@ -458,7 +458,6 @@ pub async fn transmit_sor_request(
|
||||||
/// can be executed from the gui.
|
/// can be executed from the gui.
|
||||||
pub async fn trigger_ship_request(
|
pub async fn trigger_ship_request(
|
||||||
contact: &String,
|
contact: &String,
|
||||||
db_key: &String,
|
|
||||||
jwp: &String,
|
jwp: &String,
|
||||||
orid: &String,
|
orid: &String,
|
||||||
) -> Order {
|
) -> Order {
|
||||||
|
@ -477,9 +476,6 @@ pub async fn trigger_ship_request(
|
||||||
}
|
}
|
||||||
let unwrap_order: Order = order.unwrap();
|
let unwrap_order: Order = order.unwrap();
|
||||||
backup(&unwrap_order);
|
backup(&unwrap_order);
|
||||||
let prefix = String::from(db_key);
|
|
||||||
utils::clear_gui_db(String::from(&prefix), String::from(orid));
|
|
||||||
utils::write_gui_db(prefix, String::from(orid), String::from(orid));
|
|
||||||
unwrap_order
|
unwrap_order
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -488,11 +484,10 @@ pub async fn d_trigger_ship_request(
|
||||||
contact: &String,
|
contact: &String,
|
||||||
jwp: &String,
|
jwp: &String,
|
||||||
orid: &String,
|
orid: &String,
|
||||||
status: &String,
|
|
||||||
) -> Order {
|
) -> Order {
|
||||||
info!("executing d_trigger_ship_request");
|
info!("executing d_trigger_ship_request");
|
||||||
// request shipment if the order status is MultisigComplete
|
// request shipment if the order status is MultisigComplete
|
||||||
let trigger = trigger_ship_request(contact, jwp, orid, status).await;
|
let trigger = trigger_ship_request(contact, jwp, orid).await;
|
||||||
if trigger.status == order::StatusType::MulitsigComplete.value() {
|
if trigger.status == order::StatusType::MulitsigComplete.value() {
|
||||||
let ship_res = transmit_ship_request(contact, jwp, orid).await;
|
let ship_res = transmit_ship_request(contact, jwp, orid).await;
|
||||||
if ship_res.is_err() {
|
if ship_res.is_err() {
|
||||||
|
|
|
@ -627,10 +627,10 @@ impl eframe::App for MarketApp {
|
||||||
|
|
||||||
if self.msig.completed_export && !self.msig.completed_shipping_request {
|
if self.msig.completed_export && !self.msig.completed_shipping_request {
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
let vendor_prefix = String::from(crate::GUI_OVL_DB_KEY);
|
|
||||||
let vendor = utils::search_gui_db(vendor_prefix, self.m_order.orid.clone());
|
|
||||||
ui.label("Request Shipping: \t");
|
ui.label("Request Shipping: \t");
|
||||||
if ui.button("Send").clicked() {
|
if ui.button("Send").clicked() {
|
||||||
|
let vendor_prefix = String::from(crate::GUI_OVL_DB_KEY);
|
||||||
|
let vendor = utils::search_gui_db(vendor_prefix, self.m_order.orid.clone());
|
||||||
self.is_loading = true;
|
self.is_loading = true;
|
||||||
let jwp = utils::search_gui_db(
|
let jwp = utils::search_gui_db(
|
||||||
String::from(crate::GUI_JWP_DB_KEY),
|
String::from(crate::GUI_JWP_DB_KEY),
|
||||||
|
@ -2058,6 +2058,7 @@ fn verify_order_wallet_funded(
|
||||||
let order_id = String::from(orid);
|
let order_id = String::from(orid);
|
||||||
let l_contact = String::from(contact);
|
let l_contact = String::from(contact);
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
|
log::info!("executing verify_order_wallet_funded");
|
||||||
let wallet_password = utils::empty_string();
|
let wallet_password = utils::empty_string();
|
||||||
monero::open_wallet(&order_id, &wallet_password).await;
|
monero::open_wallet(&order_id, &wallet_password).await;
|
||||||
let _ = monero::refresh().await;
|
let _ = monero::refresh().await;
|
||||||
|
@ -2083,6 +2084,7 @@ fn verify_order_wallet_funded(
|
||||||
let total = &order.quantity & &product.price;
|
let total = &order.quantity & &product.price;
|
||||||
if pre_bal.result.balance < total {
|
if pre_bal.result.balance < total {
|
||||||
let _ = tx.send(false);
|
let _ = tx.send(false);
|
||||||
|
ctx.request_repaint();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let _ = tx.send(true);
|
let _ = tx.send(true);
|
||||||
|
@ -2152,8 +2154,7 @@ fn shipping_req(
|
||||||
let v_jwp = String::from(jwp);
|
let v_jwp = String::from(jwp);
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
log::info!("shipping order req: {}", ship_orid);
|
log::info!("shipping order req: {}", ship_orid);
|
||||||
let db_key: String = String::from(crate::GUI_OVL_DB_KEY);
|
let order = order::d_trigger_ship_request(&vendor_i2p, &v_jwp, &ship_orid).await;
|
||||||
let order = order::d_trigger_ship_request(&vendor_i2p, &db_key, &v_jwp, &ship_orid).await;
|
|
||||||
let _ = tx.send(order);
|
let _ = tx.send(order);
|
||||||
ctx.request_repaint();
|
ctx.request_repaint();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue