Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
Revert "fix: loading exception when switching workspace"
Lucas.Xu343f7e4fd5f9
diff --git a/frontend/appflowy_flutter/lib/shared/loading.dart b/frontend/appflowy_flutter/lib/shared/loading.dartindex 3958601ed8..f8d1c6fc86 100644--- a/frontend/appflowy_flutter/lib/shared/loading.dart+++ b/frontend/appflowy_flutter/lib/shared/loading.dart@@ -40,11 +40,7 @@ class Loading {void stop() {if (loadingContext != null) {- if (loadingContext!.mounted) {- if (Navigator.canPop(loadingContext!)) {- Navigator.of(loadingContext!).pop();- }- }+ Navigator.of(loadingContext!).pop();loadingContext = null;}diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/sidebar_workspace.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/sidebar_workspace.dartindex 07a5aeec4e..50ea9d83c7 100644--- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/sidebar_workspace.dart+++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/sidebar_workspace.dart@@ -32,10 +32,7 @@ class _SidebarWorkspaceState extends State<SidebarWorkspace> {@overridevoid dispose() {onHover.dispose();- if (loadingIndicator != null) {- loadingIndicator?.stop();- loadingIndicator = null;- }+super.dispose();}@@ -103,10 +100,8 @@ class _SidebarWorkspaceState extends State<SidebarWorkspace> {if (isLoading) {loadingIndicator ??= Loading(context)..start();return;- } else if (loadingIndicator != null) {- if (mounted) {- loadingIndicator?.stop();- }+ } else {+ loadingIndicator?.stop();loadingIndicator = null;}