Skip to content

Commit

Permalink
chore: only fetch billing info when current user is the workspace own…
Browse files Browse the repository at this point in the history
…er (#6847)
  • Loading branch information
appflowy authored Nov 23, 2024
1 parent b5d2af3 commit 1b4a723
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';

import 'package:appflowy/core/helpers/url_launcher.dart';
import 'package:appflowy/shared/af_role_pb_extension.dart';
import 'package:appflowy/user/application/user_service.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/log.dart';
Expand Down Expand Up @@ -44,6 +45,10 @@ class WorkspaceMemberBloc
(e) => [],
);
final myRole = _getMyRole(members);

if (myRole.isOwner) {
unawaited(_fetchWorkspaceSubscriptionInfo());
}
emit(
state.copyWith(
members: members,
Expand Down Expand Up @@ -215,8 +220,6 @@ class WorkspaceMemberBloc
_workspaceId = '';
});
}

unawaited(_fetchWorkspaceSubscriptionInfo());
}

// We fetch workspace subscription info lazily as it's not needed in the first
Expand Down

0 comments on commit 1b4a723

Please sign in to comment.