mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
[flutter]: fix ui update
This commit is contained in:
parent
d1b7fd29a6
commit
315c8b107a
@ -1,4 +1,5 @@
|
||||
import 'dart:typed_data';
|
||||
import 'package:flowy_log/flowy_log.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-dart-notify/protobuf.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
|
||||
@ -49,15 +50,13 @@ class NotificationParser<T, E> {
|
||||
return;
|
||||
}
|
||||
|
||||
if (subject.hasPayload()) {
|
||||
final bytes = Uint8List.fromList(subject.payload);
|
||||
callback(ty, left(bytes));
|
||||
} else if (subject.hasError()) {
|
||||
if (subject.hasError()) {
|
||||
final bytes = Uint8List.fromList(subject.error);
|
||||
final error = errorParser(bytes);
|
||||
callback(ty, right(error));
|
||||
} else {
|
||||
// do nothing
|
||||
final bytes = Uint8List.fromList(subject.payload);
|
||||
callback(ty, left(bytes));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,9 +56,8 @@ impl TrashCan {
|
||||
let _ = thread::scope(|_s| {
|
||||
let conn = self.database.db_connection()?;
|
||||
let _ = conn.immediate_transaction::<_, WorkspaceError, _>(|| {
|
||||
let repeated_trash = TrashTableSql::read_all(&conn)?;
|
||||
let _ = TrashTableSql::delete_trash(trash_id, &*conn)?;
|
||||
notify_trash_num_changed(repeated_trash);
|
||||
notify_trash_num_changed(TrashTableSql::read_all(&conn)?);
|
||||
Ok(())
|
||||
})?;
|
||||
Ok::<(), WorkspaceError>(())
|
||||
@ -128,8 +127,7 @@ impl TrashCan {
|
||||
let _ = TrashTableSql::create_trash(t.clone().into(), &*conn)?;
|
||||
}
|
||||
self.create_trash_on_server(trash);
|
||||
let repeated_trash = TrashTableSql::read_all(&conn)?;
|
||||
notify_trash_num_changed(repeated_trash);
|
||||
notify_trash_num_changed(TrashTableSql::read_all(&conn)?);
|
||||
Ok(())
|
||||
})?;
|
||||
Ok::<(), WorkspaceError>(())
|
||||
|
Loading…
Reference in New Issue
Block a user