mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: refresh UI after deleting all sorts (#2573)
* chore: disable snapshot for now * chore: notify the fronted to refresh after deleting all the sorts
This commit is contained in:
@ -51,9 +51,7 @@ impl DatabaseManager2 {
|
||||
*self.user_database.lock() = Some(InnerUserDatabase::new(
|
||||
user_id,
|
||||
db,
|
||||
RocksDBConfig::default()
|
||||
.enable_snapshot(true)
|
||||
.snapshot_per_update(10),
|
||||
RocksDBConfig::default(),
|
||||
UserDatabaseCollabBuilderImpl(self.collab_builder.clone()),
|
||||
));
|
||||
// do nothing
|
||||
|
@ -465,8 +465,9 @@ impl DatabaseViewEditor {
|
||||
|
||||
pub async fn v_delete_all_sorts(&self) -> FlowyResult<()> {
|
||||
let all_sorts = self.v_get_all_sorts().await;
|
||||
self.delegate.remove_all_sorts(&self.view_id);
|
||||
self.sort_controller.write().await.delete_all_sorts().await;
|
||||
|
||||
self.delegate.remove_all_sorts(&self.view_id);
|
||||
let mut notification = SortChangesetNotificationPB::new(self.view_id.clone());
|
||||
notification.delete_sorts = all_sorts.into_iter().map(SortPB::from).collect();
|
||||
notify_did_update_sort(notification).await;
|
||||
|
@ -90,7 +90,7 @@ impl SortController {
|
||||
let event_type = SortEvent::from_str(predicate).unwrap();
|
||||
let mut rows = self.delegate.get_rows(&self.view_id).await;
|
||||
match event_type {
|
||||
SortEvent::SortDidChanged => {
|
||||
SortEvent::SortDidChanged | SortEvent::DeleteAllSorts => {
|
||||
self.sort_rows(&mut rows).await;
|
||||
let row_orders = rows
|
||||
.iter()
|
||||
@ -165,7 +165,7 @@ impl SortController {
|
||||
pub async fn delete_all_sorts(&mut self) {
|
||||
self.sorts.clear();
|
||||
self
|
||||
.gen_task(SortEvent::SortDidChanged, QualityOfService::Background)
|
||||
.gen_task(SortEvent::DeleteAllSorts, QualityOfService::Background)
|
||||
.await;
|
||||
}
|
||||
|
||||
@ -292,6 +292,7 @@ fn cmp_cell(
|
||||
enum SortEvent {
|
||||
SortDidChanged,
|
||||
RowDidChanged(RowId),
|
||||
DeleteAllSorts,
|
||||
}
|
||||
|
||||
impl ToString for SortEvent {
|
||||
|
Reference in New Issue
Block a user