mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: open latest view
This commit is contained in:
parent
41084da708
commit
81ecbd8ae2
@ -34,19 +34,6 @@ class HomeScreen extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _HomeScreenState extends State<HomeScreen> {
|
class _HomeScreenState extends State<HomeScreen> {
|
||||||
ViewPB? initialView;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didUpdateWidget(covariant HomeScreen oldWidget) {
|
|
||||||
initialView = null;
|
|
||||||
super.didUpdateWidget(oldWidget);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MultiBlocProvider(
|
return MultiBlocProvider(
|
||||||
@ -129,15 +116,6 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
required BuildContext context,
|
required BuildContext context,
|
||||||
required HomeState state}) {
|
required HomeState state}) {
|
||||||
final workspaceSetting = state.workspaceSetting;
|
final workspaceSetting = state.workspaceSetting;
|
||||||
if (initialView == null && workspaceSetting.hasLatestView()) {
|
|
||||||
initialView = workspaceSetting.latestView;
|
|
||||||
final plugin = makePlugin(
|
|
||||||
pluginType: initialView!.pluginType,
|
|
||||||
data: initialView,
|
|
||||||
);
|
|
||||||
getIt<HomeStackManager>().setPlugin(plugin);
|
|
||||||
}
|
|
||||||
|
|
||||||
final homeMenu = HomeMenu(
|
final homeMenu = HomeMenu(
|
||||||
user: widget.user,
|
user: widget.user,
|
||||||
workspaceSetting: workspaceSetting,
|
workspaceSetting: workspaceSetting,
|
||||||
@ -150,7 +128,6 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
// All opened widgets that display on the home screen are in the form
|
// All opened widgets that display on the home screen are in the form
|
||||||
// of plugins. There is a list of built-in plugins defined in the
|
// of plugins. There is a list of built-in plugins defined in the
|
||||||
// [PluginType] enum, including board, grid and trash.
|
// [PluginType] enum, including board, grid and trash.
|
||||||
|
|
||||||
if (getIt<HomeStackManager>().plugin.ty == PluginType.blank) {
|
if (getIt<HomeStackManager>().plugin.ty == PluginType.blank) {
|
||||||
// Open the last opened view.
|
// Open the last opened view.
|
||||||
if (workspaceSetting.hasLatestView()) {
|
if (workspaceSetting.hasLatestView()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user