mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-30 17:58:58 -04:00
refactor cubits to keep them alive, wip
This commit is contained in:
parent
360ba436f8
commit
3edf2ebb46
13 changed files with 550 additions and 158 deletions
|
@ -10,14 +10,18 @@ class AccountInfoCubit extends Cubit<AccountInfo> {
|
|||
AccountInfoCubit(
|
||||
AccountRepository accountRepository, TypedKey superIdentityRecordKey)
|
||||
: _accountRepository = accountRepository,
|
||||
super(accountRepository.getAccountInfo(superIdentityRecordKey)) {
|
||||
super(accountRepository.getAccountInfo(superIdentityRecordKey)!) {
|
||||
// Subscribe to streams
|
||||
_accountRepositorySubscription = _accountRepository.stream.listen((change) {
|
||||
switch (change) {
|
||||
case AccountRepositoryChange.activeLocalAccount:
|
||||
case AccountRepositoryChange.localAccounts:
|
||||
case AccountRepositoryChange.userLogins:
|
||||
emit(accountRepository.getAccountInfo(superIdentityRecordKey));
|
||||
final acctInfo =
|
||||
accountRepository.getAccountInfo(superIdentityRecordKey);
|
||||
if (acctInfo != null) {
|
||||
emit(acctInfo);
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue