Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: enable collaborator (#5051)

Lucas.Xu0ace8323743d
diff --git a/frontend/appflowy_flutter/lib/plugins/document/application/doc_collaborators_bloc.dart b/frontend/appflowy_flutter/lib/plugins/document/application/doc_collaborators_bloc.dart
index 92fdfa001b..9d1eca931a 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/application/doc_collaborators_bloc.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/application/doc_collaborators_bloc.dart
@@ -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),
+ 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,
+ ),
+ );
+ },
);
- return;
}
- final deviceId = ApplicationInfo.deviceId;
- _listener.start(
- onDocAwarenessUpdate: (states) {
- add(
- DocumentCollaboratorsEvent.update(
- userProfile,
- deviceId,
- states,
- ),
- );
- },
- );
},
update: (userProfile, deviceId, states) {
final collaborators = _buildCollaborators(