mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Merge pull request #659 from AppFlowy-IO/fix/resize_window_issue
fix: open the latest view when AppFlowy launch.
This commit is contained in:
commit
5cf1ede6f0
@ -122,7 +122,10 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
);
|
||||
|
||||
final latestView = workspaceSetting.hasLatestView() ? workspaceSetting.latestView : null;
|
||||
getIt<MenuSharedState>().latestOpenView = latestView;
|
||||
if (getIt<MenuSharedState>().latestOpenView == null) {
|
||||
/// AppFlowy will open the view that the last time the user opened it. The _buildHomeMenu will get called when AppFlowy's screen resizes. So we only set the latestOpenView when it's null.
|
||||
getIt<MenuSharedState>().latestOpenView = latestView;
|
||||
}
|
||||
|
||||
return FocusTraversalGroup(child: RepaintBoundary(child: homeMenu));
|
||||
}
|
||||
|
@ -164,7 +164,9 @@ class MenuSharedState {
|
||||
ViewPB? get latestOpenView => _latestOpenView.value;
|
||||
|
||||
set latestOpenView(ViewPB? view) {
|
||||
_latestOpenView.value = view;
|
||||
if (_latestOpenView.value != view) {
|
||||
_latestOpenView.value = view;
|
||||
}
|
||||
}
|
||||
|
||||
VoidCallback addLatestViewListener(void Function(ViewPB?) callback) {
|
||||
|
Loading…
Reference in New Issue
Block a user