From d8668f9025f129c73c1fb6d573affae3acb28ab1 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Mon, 8 Jul 2024 11:06:21 +0800 Subject: [PATCH] chore: revert last opened view code --- .../lib/workspace/application/home/home_bloc.dart | 5 +++++ .../workspace/presentation/home/menu/sidebar/sidebar.dart | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/appflowy_flutter/lib/workspace/application/home/home_bloc.dart b/frontend/appflowy_flutter/lib/workspace/application/home/home_bloc.dart index f55e09747db39..2fb801595cacb 100644 --- a/frontend/appflowy_flutter/lib/workspace/application/home/home_bloc.dart +++ b/frontend/appflowy_flutter/lib/workspace/application/home/home_bloc.dart @@ -48,9 +48,14 @@ class HomeBloc extends Bloc { emit(state.copyWith(isLoading: e.isLoading)); }, didReceiveWorkspaceSetting: (_DidReceiveWorkspaceSetting value) { + final latestView = value.setting.hasLatestView() + ? value.setting.latestView + : state.latestView; + emit( state.copyWith( workspaceSetting: value.setting, + latestView: latestView, ), ); }, diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar.dart index b080606b57e9f..e7f8b7989a71a 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar.dart @@ -121,7 +121,7 @@ class HomeSideBar extends StatelessWidget { userProfile, state.currentWorkspace?.workspaceId ?? workspaceSetting.workspaceId, - openFirstPage: true, + openFirstPage: false, ), ), ),