@@ -4,6 +4,7 @@ import 'package:appflowy/startup/startup.dart';
4
4
import 'package:appflowy/workspace/presentation/home/menu/sidebar/space/shared_widget.dart' ;
5
5
import 'package:appflowy/workspace/presentation/settings/widgets/members/workspace_member_bloc.dart' ;
6
6
import 'package:appflowy/workspace/presentation/widgets/dialogs.dart' ;
7
+ import 'package:appflowy_backend/protobuf/flowy-user/workspace.pbenum.dart' ;
7
8
import 'package:appflowy_ui/appflowy_ui.dart' ;
8
9
import 'package:easy_localization/easy_localization.dart' ;
9
10
import 'package:flutter/gestures.dart' ;
@@ -86,11 +87,14 @@ class _Description extends StatelessWidget {
86
87
87
88
Future <void > _onGenerateInviteLink (BuildContext context) async {
88
89
final state = context.read <WorkspaceMemberBloc >().state;
90
+ final subscriptionInfo = state.subscriptionInfo;
89
91
final inviteLink = state.inviteLink;
90
92
91
93
// check the current workspace member count, if it exceed the limit, show a upgrade dialog.
92
94
// prevent hard code here, because the member count may exceed the limit after the invite link is generated.
93
- if (inviteLink == null && state.members.length >= 3 ) {
95
+ if (inviteLink == null &&
96
+ subscriptionInfo? .plan == WorkspacePlanPB .FreePlan &&
97
+ state.members.length >= 2 ) {
94
98
await showConfirmDialog (
95
99
context: context,
96
100
title:
@@ -165,9 +169,11 @@ class _CopyLinkButtonState extends State<_CopyLinkButton> {
165
169
),
166
170
onTap: () async {
167
171
final state = context.read <WorkspaceMemberBloc >().state;
172
+ final subscriptionInfo = state.subscriptionInfo;
168
173
// check the current workspace member count, if it exceed the limit, show a upgrade dialog.
169
174
// prevent hard code here, because the member count may exceed the limit after the invite link is generated.
170
- if (state.members.length >= 3 ) {
175
+ if (subscriptionInfo? .plan == WorkspacePlanPB .FreePlan &&
176
+ state.members.length >= 2 ) {
171
177
await showConfirmDialog (
172
178
context: context,
173
179
title: LocaleKeys
0 commit comments