mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 23:34:49 +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)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum Event {
|
pub enum Event {
|
||||||
FileTreeUpdated,
|
FileTreeUpdated(String),
|
||||||
UserJoin(String),
|
UserJoin(String),
|
||||||
UserLeave(String),
|
UserLeave(String),
|
||||||
}
|
}
|
||||||
|
@ -12,9 +12,9 @@ impl From<&WorkspaceEventInner> for Event {
|
||||||
match event {
|
match event {
|
||||||
WorkspaceEventInner::Join(e) => Self::UserJoin(e.user.id.clone()),
|
WorkspaceEventInner::Join(e) => Self::UserJoin(e.user.id.clone()),
|
||||||
WorkspaceEventInner::Leave(e) => Self::UserLeave(e.user.id.clone()),
|
WorkspaceEventInner::Leave(e) => Self::UserLeave(e.user.id.clone()),
|
||||||
WorkspaceEventInner::Create(_)
|
WorkspaceEventInner::Create(e) => Self::FileTreeUpdated(e.path.clone()),
|
||||||
| WorkspaceEventInner::Rename(_)
|
WorkspaceEventInner::Delete(e) => Self::FileTreeUpdated(e.path.clone()),
|
||||||
| WorkspaceEventInner::Delete(_) => Self::FileTreeUpdated,
|
WorkspaceEventInner::Rename(e) => Self::FileTreeUpdated(e.after.clone()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue