Add Personal tab and fix org selection + API error handling
This commit is contained in:
@@ -131,8 +131,9 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
final name = controller.text.trim();
|
||||
if (name.isNotEmpty) {
|
||||
// Use the parent context, not the dialog context
|
||||
BlocProvider.of<OrganizationBloc>(context)
|
||||
.add(CreateOrganization(name));
|
||||
BlocProvider.of<OrganizationBloc>(
|
||||
context,
|
||||
).add(CreateOrganization(name));
|
||||
Navigator.of(dialogContext).pop();
|
||||
}
|
||||
},
|
||||
@@ -151,8 +152,9 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
final name = controller.text.trim();
|
||||
if (name.isNotEmpty) {
|
||||
// Use the parent context, not the dialog context
|
||||
BlocProvider.of<OrganizationBloc>(context)
|
||||
.add(CreateOrganization(name));
|
||||
BlocProvider.of<OrganizationBloc>(
|
||||
context,
|
||||
).add(CreateOrganization(name));
|
||||
Navigator.of(dialogContext).pop();
|
||||
}
|
||||
},
|
||||
@@ -189,6 +191,18 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
// Personal workspace button (always show when logged in)
|
||||
_buildOrgButton(
|
||||
Organization(id: '', name: 'Personal'),
|
||||
selectedOrg == null,
|
||||
() {
|
||||
context.read<OrganizationBloc>().add(
|
||||
SelectOrganization(''),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
// Organization tabs
|
||||
...orgs.map(
|
||||
(org) => Row(
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user