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