Support personal workspace without requiring organization
This commit is contained in:
@@ -190,10 +190,16 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildDrive(OrganizationState state) {
|
Widget _buildDrive(OrganizationState state, AuthState authState) {
|
||||||
return state is OrganizationLoaded && state.selectedOrg != null
|
if (state is OrganizationLoaded && state.selectedOrg != null) {
|
||||||
? FileExplorer(orgId: state.selectedOrg!.id)
|
// Show selected organization's files
|
||||||
: const FileExplorer(orgId: 'org1');
|
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}) {
|
Widget _buildNavButton(String label, IconData icon, {bool isAvatar = false}) {
|
||||||
@@ -313,6 +319,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: _buildDrive(
|
child: _buildDrive(
|
||||||
orgState,
|
orgState,
|
||||||
|
state,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user