mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-06-05 21:29:27 -04:00
theming work, revamp contact invitation
This commit is contained in:
parent
3c95c9d1a3
commit
ae841ec42a
26 changed files with 504 additions and 507 deletions
|
@ -14,7 +14,6 @@ class ActiveLocalAccountCubit extends Cubit<TypedKey?> {
|
|||
switch (change) {
|
||||
case AccountRepositoryChange.activeLocalAccount:
|
||||
emit(_accountRepository.getActiveLocalAccount());
|
||||
break;
|
||||
// Ignore these
|
||||
case AccountRepositoryChange.localAccounts:
|
||||
case AccountRepositoryChange.userLogins:
|
||||
|
|
|
@ -32,6 +32,7 @@ class PerAccountCollectionState with _$PerAccountCollectionState {
|
|||
}
|
||||
|
||||
extension PerAccountCollectionStateExt on PerAccountCollectionState {
|
||||
// Returns if the account is ready and logged in
|
||||
bool get isReady =>
|
||||
avAccountRecordState != null &&
|
||||
avAccountRecordState!.isData &&
|
||||
|
@ -45,7 +46,11 @@ extension PerAccountCollectionStateExt on PerAccountCollectionState {
|
|||
activeConversationsBlocMapCubit != null &&
|
||||
activeSingleContactChatBlocMapCubit != null;
|
||||
|
||||
Widget provide({required Widget child}) => MultiBlocProvider(providers: [
|
||||
/// If we have a selected account and it is ready and not locked,
|
||||
/// this will provide the unlocked account's cubits to the context
|
||||
Widget provideReady({required Widget child}) {
|
||||
if (isReady) {
|
||||
return MultiBlocProvider(providers: [
|
||||
BlocProvider.value(value: accountInfoCubit!),
|
||||
BlocProvider.value(value: accountRecordCubit!),
|
||||
BlocProvider.value(value: contactInvitationListCubit!),
|
||||
|
@ -56,4 +61,9 @@ extension PerAccountCollectionStateExt on PerAccountCollectionState {
|
|||
BlocProvider.value(value: activeConversationsBlocMapCubit!),
|
||||
BlocProvider.value(value: activeSingleContactChatBlocMapCubit!),
|
||||
], child: child);
|
||||
} else {
|
||||
// Otherwise we just provide the child
|
||||
return child;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue