Support personal workspace without requiring organization

This commit is contained in:
Leon Bösche
2026-01-08 21:40:55 +01:00
parent 1eb8781550
commit 7adde54a41

View File

@@ -190,10 +190,16 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
);
}
Widget _buildDrive(OrganizationState state) {
return state is OrganizationLoaded && state.selectedOrg != null
? FileExplorer(orgId: state.selectedOrg!.id)
: const FileExplorer(orgId: 'org1');
Widget _buildDrive(OrganizationState state, AuthState authState) {
if (state is OrganizationLoaded && state.selectedOrg != null) {
// Show selected organization's files
return FileExplorer(orgId: state.selectedOrg!.id);
} else if (authState is AuthAuthenticated) {
// Show personal workspace using user's email as workspace ID
return FileExplorer(orgId: authState.user.email ?? 'personal');
} else {
return const FileExplorer(orgId: 'personal');
}
}
Widget _buildNavButton(String label, IconData icon, {bool isAvatar = false}) {
@@ -313,6 +319,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
Expanded(
child: _buildDrive(
orgState,
state,
),
),
],