mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-08-12 19:01:16 +00:00
fix: loading exception when switching workspace
This commit is contained in:
parent
65b7916a6a
commit
10a536b1a2
@ -40,7 +40,11 @@ class Loading {
|
||||
|
||||
void stop() {
|
||||
if (loadingContext != null) {
|
||||
Navigator.of(loadingContext!).pop();
|
||||
if (loadingContext!.mounted) {
|
||||
if (Navigator.canPop(loadingContext!)) {
|
||||
Navigator.of(loadingContext!).pop();
|
||||
}
|
||||
}
|
||||
loadingContext = null;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,10 @@ class _SidebarWorkspaceState extends State<SidebarWorkspace> {
|
||||
@override
|
||||
void dispose() {
|
||||
onHover.dispose();
|
||||
|
||||
if (loadingIndicator != null) {
|
||||
loadingIndicator?.stop();
|
||||
loadingIndicator = null;
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@ -100,8 +103,10 @@ class _SidebarWorkspaceState extends State<SidebarWorkspace> {
|
||||
if (isLoading) {
|
||||
loadingIndicator ??= Loading(context)..start();
|
||||
return;
|
||||
} else {
|
||||
loadingIndicator?.stop();
|
||||
} else if (loadingIndicator != null) {
|
||||
if (mounted) {
|
||||
loadingIndicator?.stop();
|
||||
}
|
||||
loadingIndicator = null;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user