22 lines
655 B
Rust
Raw Normal View History

2022-06-29 13:44:15 +08:00
use crate::services::grid_editor::GridRevisionEditor;
2022-06-29 16:55:52 +08:00
use crate::services::tasks::{GridTaskHandler, Task, TaskContent, TaskHandlerId};
2022-06-29 13:44:15 +08:00
use flowy_error::FlowyError;
2022-06-29 16:55:52 +08:00
2022-06-29 13:44:15 +08:00
use lib_infra::future::BoxResultFuture;
2022-06-29 16:55:52 +08:00
impl GridTaskHandler for GridRevisionEditor {
fn handler_id(&self) -> &TaskHandlerId {
2022-06-29 13:44:15 +08:00
&self.grid_id
}
fn process_task(&self, task: Task) -> BoxResultFuture<(), FlowyError> {
Box::pin(async move {
2022-06-29 16:55:52 +08:00
match &task.content {
2022-06-29 13:44:15 +08:00
TaskContent::Snapshot { .. } => {}
2022-06-29 16:55:52 +08:00
TaskContent::Filter => self.filter_service.process_task(task).await?,
2022-06-29 13:44:15 +08:00
}
Ok(())
})
}
}