chore: enable collaborator (#5051)

This commit is contained in:
Lucas.Xu 2024-04-04 09:09:53 +08:00 committed by GitHub
parent 382ce827c1
commit 0ace832374
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,14 +29,14 @@ class DocumentCollaboratorsBloc
initial: () async {
final result = await getIt<AuthService>().getUser();
final userProfile = result.fold((s) => s, (f) => null);
if (userProfile == null ||
userProfile.authenticator == AuthenticatorPB.Local) {
emit(
state.copyWith(shouldShowIndicator: false),
state.copyWith(
shouldShowIndicator:
userProfile?.authenticator != AuthenticatorPB.Local,
),
);
return;
}
final deviceId = ApplicationInfo.deviceId;
if (userProfile != null) {
_listener.start(
onDocAwarenessUpdate: (states) {
add(
@ -48,6 +48,7 @@ class DocumentCollaboratorsBloc
);
},
);
}
},
update: (userProfile, deviceId, states) {
final collaborators = _buildCollaborators(