From 1f328345728079a70c71f316f0f4dc41cc3b2d81 Mon Sep 17 00:00:00 2001 From: alemidev Date: Mon, 29 Aug 2022 02:49:24 +0200 Subject: [PATCH] fix: send buffer events --- src/server/actor/workspace.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/server/actor/workspace.rs b/src/server/actor/workspace.rs index 5f204af..4df610d 100644 --- a/src/server/actor/workspace.rs +++ b/src/server/actor/workspace.rs @@ -117,10 +117,13 @@ impl Workspace { let action = rx.recv().await.unwrap(); match action { BufferAction::ADD { buffer } => { - buffers.insert(buffer.view().name.clone(), buffer); + let view = buffer.view(); + buffers.insert(view.name.clone(), buffer); + bus.send(Event::BufferNew { path: view.name }).unwrap(); } BufferAction::REMOVE { path } => { buffers.remove(&path); + bus.send(Event::BufferDelete { path: path }).unwrap(); } } tx.send( @@ -177,7 +180,7 @@ impl Workspace { } #[derive(Debug)] -pub enum UserAction { +enum UserAction { ADD { user: User, }, @@ -191,7 +194,7 @@ pub enum UserAction { } #[derive(Debug)] -pub enum BufferAction { +enum BufferAction { ADD { buffer: Buffer, },