Skip to content

Commit

Permalink
merge: #3264
Browse files Browse the repository at this point in the history
3264: fix(dal): fire ws_event when component position is set r=stack72 a=britmyerss

Small change - doesn't fix the frames issue we're seeing but it at least makes it a little easier to collaborate within a changeset 

Co-authored-by: Brit Myers <[email protected]>
  • Loading branch information
si-bors-ng[bot] and britmyerss authored Feb 7, 2024
2 parents 8240425 + acb67a5 commit 1a9c74a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/dal/src/node.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::ws_event::{WsEvent, WsEventError};
use rand::prelude::SliceRandom;
use rand::thread_rng;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -50,6 +51,8 @@ pub enum NodeError {
SummaryDiagram(String),
#[error("transactions error: {0}")]
Transactions(#[from] TransactionsError),
#[error("ws event error: {0}")]
WsEvent(#[from] WsEventError),
}

pub type NodeResult<T> = Result<T, NodeError>;
Expand Down Expand Up @@ -304,6 +307,18 @@ impl Node {
)
.await
.map_err(|e| NodeError::SummaryDiagram(e.to_string()))?;
let component = self
.component(ctx)
.await?
.ok_or(NodeError::ComponentIsNone)?;

let component_id = component.id();

WsEvent::component_updated(ctx, *component_id)
.await?
.publish_on_commit(ctx)
.await?;

Ok(())
}
}

0 comments on commit 1a9c74a

Please sign in to comment.