mirror of
https://github.com/hexedtech/codemp.git
synced 2024-12-23 05:14:54 +01:00
feat: added the file name changed to the workspace event (uniform non-unit variant enum)
This commit is contained in:
parent
0d3af40eb0
commit
9d5aae461f
1 changed files with 4 additions and 4 deletions
|
@ -2,7 +2,7 @@ use codemp_proto::workspace::workspace_event::Event as WorkspaceEventInner;
|
|||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum Event {
|
||||
FileTreeUpdated,
|
||||
FileTreeUpdated(String),
|
||||
UserJoin(String),
|
||||
UserLeave(String),
|
||||
}
|
||||
|
@ -12,9 +12,9 @@ impl From<&WorkspaceEventInner> for Event {
|
|||
match event {
|
||||
WorkspaceEventInner::Join(e) => Self::UserJoin(e.user.id.clone()),
|
||||
WorkspaceEventInner::Leave(e) => Self::UserLeave(e.user.id.clone()),
|
||||
WorkspaceEventInner::Create(_)
|
||||
| WorkspaceEventInner::Rename(_)
|
||||
| WorkspaceEventInner::Delete(_) => Self::FileTreeUpdated,
|
||||
WorkspaceEventInner::Create(e) => Self::FileTreeUpdated(e.path.clone()),
|
||||
WorkspaceEventInner::Delete(e) => Self::FileTreeUpdated(e.path.clone()),
|
||||
WorkspaceEventInner::Rename(e) => Self::FileTreeUpdated(e.after.clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue