Add error handling for organization loading in HomePage

This commit is contained in:
Leon Bösche
2026-01-09 23:14:45 +01:00
parent aac6d2eb46
commit 708d4ca790
2 changed files with 391 additions and 356 deletions

View File

@@ -345,6 +345,17 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
>(
listener: (context, state) {
if (state is OrganizationLoaded) {
// Show errors if present
if (state.error != null &&
state.error!.isNotEmpty) {
ScaffoldMessenger.of(
context,
).showSnackBar(
SnackBar(
content: Text(state.error!),
),
);
}
final orgId =
state.selectedOrg?.id ?? '';
// Reload file browser when org changes (or when falling back to personal workspace)