fix: ref view in document (#2685)

* fix: remove set ref view in document as the current view

* ci: fix tests

* ci: fix tauri build
This commit is contained in:
Nathan.fooo
2023-06-03 13:40:12 +08:00
committed by GitHub
parent 5994cc135f
commit 4fa39f298c
19 changed files with 76 additions and 40 deletions

View File

@ -26,8 +26,6 @@ class DatabaseViewBackendService {
}
Future<Either<DatabasePB, FlowyError>> openGrid() async {
await FolderEventSetLatestView(ViewIdPB(value: viewId)).send();
final payload = DatabaseViewIdPB(value: viewId);
return DatabaseEventGetDatabase(payload).send();
}

View File

@ -38,6 +38,7 @@ class DatabaseViewPlugin extends Plugin {
(updatedView) {
if (_view.layout != updatedView.layout) {
_innerPlugin = _makeInnerPlugin(updatedView);
getIt<HomeStackManager>().setPlugin(_innerPlugin);
}
_view = updatedView;

View File

@ -22,9 +22,6 @@ class DocumentService {
Future<Either<FlowyError, DocumentDataPB>> openDocument({
required ViewPB view,
}) async {
// set the latest view
await FolderEventSetLatestView(ViewIdPB(value: view.id)).send();
final payload = OpenDocumentPayloadPB()..documentId = view.id;
final result = await DocumentEventOpenDocument(payload).send();
return result.swap();