Skip to content

Commit

Permalink
Merge pull request #2507 from get10101/fix/show-pending-dialog-immedi…
Browse files Browse the repository at this point in the history
…ately

fix: Show pending trade dialog immediately when submitting an order
  • Loading branch information
holzeis authored May 8, 2024
2 parents f0f2710 + 2556c0e commit 02bd2fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mobile/native/src/trade/order/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ pub async fn submit_order(
order: Order,
channel_opening_params: Option<ChannelOpeningParams>,
) -> Result<Uuid, SubmitOrderError> {
event::publish(&EventInternal::BackgroundNotification(
BackgroundTask::AsyncTrade(TaskStatus::Pending),
));

submit_order_internal(order, channel_opening_params)
.await
.inspect_err(report_error_to_coordinator)
Expand Down Expand Up @@ -129,10 +133,6 @@ pub async fn submit_order_internal(
set_order_to_open_and_update_ui(order.id).map_err(SubmitOrderError::Storage)?;
update_position_after_order_submitted(&order).map_err(SubmitOrderError::Storage)?;

event::publish(&EventInternal::BackgroundNotification(
BackgroundTask::AsyncTrade(TaskStatus::Pending),
));

Ok(order.id)
}

Expand Down

0 comments on commit 02bd2fb

Please sign in to comment.