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,25 +29,26 @@ 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),
);
return;
}
final deviceId = ApplicationInfo.deviceId;
_listener.start(
onDocAwarenessUpdate: (states) {
add(
DocumentCollaboratorsEvent.update(
userProfile,
deviceId,
states,
),
);
},
emit(
state.copyWith(
shouldShowIndicator:
userProfile?.authenticator != AuthenticatorPB.Local,
),
);
final deviceId = ApplicationInfo.deviceId;
if (userProfile != null) {
_listener.start(
onDocAwarenessUpdate: (states) {
add(
DocumentCollaboratorsEvent.update(
userProfile,
deviceId,
states,
),
);
},
);
}
},
update: (userProfile, deviceId, states) {
final collaborators = _buildCollaborators(