Revert "fix: loading exception when switching workspace"

This reverts commit 10a536b1a2.
This commit is contained in:
Lucas.Xu 2025-04-21 17:20:35 +08:00
parent 4634b51edf
commit 343f7e4fd5
2 changed files with 4 additions and 13 deletions

View file

@ -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;
}

View file

@ -32,10 +32,7 @@ class _SidebarWorkspaceState extends State<SidebarWorkspace> {
@override
void 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;
}