From d26606d3d3b6873aad9a9c01e8a3a2cb0858ea72 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Thu, 14 Dec 2023 20:33:00 +0800 Subject: [PATCH] fix: unable to sync the folder data (#4141) --- .../home/personal_folder/mobile_home_personal_folder.dart | 2 +- .../lib/mobile/presentation/page_item/mobile_view_item.dart | 4 ++-- .../lib/user/presentation/screens/splash_screen.dart | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/home/personal_folder/mobile_home_personal_folder.dart b/frontend/appflowy_flutter/lib/mobile/presentation/home/personal_folder/mobile_home_personal_folder.dart index dbd0c24979..eacf54b29f 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/home/personal_folder/mobile_home_personal_folder.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/home/personal_folder/mobile_home_personal_folder.dart @@ -45,7 +45,7 @@ class MobilePersonalFolder extends StatelessWidget { ...views.map( (view) => MobileViewItem( key: ValueKey( - '${FolderCategoryType.personal.name} ${view.id}', + '${FolderCategoryType.personal.name} ${view.hashCode} ', ), isDraggable: true, categoryType: FolderCategoryType.personal, diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/page_item/mobile_view_item.dart b/frontend/appflowy_flutter/lib/mobile/presentation/page_item/mobile_view_item.dart index d4f152f0dd..27fa43a67f 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/page_item/mobile_view_item.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/page_item/mobile_view_item.dart @@ -163,7 +163,7 @@ class InnerMobileViewItem extends StatelessWidget { if (childViews.isNotEmpty) { final children = childViews.map((childView) { return MobileViewItem( - key: ValueKey('${categoryType.name} ${childView.id}'), + key: ValueKey('${categoryType.name} ${childView.hashCode}'), parentView: view, categoryType: categoryType, isFirstChild: childView.id == childViews.first.id, @@ -343,7 +343,7 @@ class _SingleMobileInnerViewItemState extends State { if (widget.startActionPane != null || widget.endActionPane != null) { child = Slidable( // Specify a key if the Slidable is dismissible. - key: ValueKey(widget.view.id), + key: ValueKey(widget.view.hashCode), startActionPane: widget.startActionPane?.call(context), endActionPane: widget.endActionPane?.call(context), child: child, diff --git a/frontend/appflowy_flutter/lib/user/presentation/screens/splash_screen.dart b/frontend/appflowy_flutter/lib/user/presentation/screens/splash_screen.dart index 7c1d88c154..b5b496cdfd 100644 --- a/frontend/appflowy_flutter/lib/user/presentation/screens/splash_screen.dart +++ b/frontend/appflowy_flutter/lib/user/presentation/screens/splash_screen.dart @@ -98,7 +98,7 @@ class SplashScreen extends StatelessWidget { '_handleUnauthenticated -> cloud is enabled: $isAuthEnabled', ); // replace Splash screen as root page - if (isAuthEnabled) { + if (isAuthEnabled || PlatformExtension.isMobile) { context.go(SignInScreen.routeName); } else { // if the env is not configured, we will skip to the 'skip login screen'.