@@ -126,18 +126,8 @@ const BotSettingsForm: React.FC<BotSettingsFormProps> = (props) => {
126
126
127
127
const classes = useStyles ( )
128
128
129
- const [ threadVisibility , setThreadVisibility ] = useState ( 'private' )
130
129
const [ data , setData ] = useState < BotSettingState [ 'data' ] | null > ( null )
131
130
132
- const isSubscriber = useMemo ( ( ) => {
133
- const hasEEPlan = orgData ?. data ?. plan === 'EE' ;
134
- const hasSEPlan = data ?. dbLabInstances ?. data
135
- ? Object . values ( data . dbLabInstances . data ) . some ( ( item ) => item . plan === "SE" )
136
- : false ;
137
-
138
- return hasEEPlan || hasSEPlan ;
139
- } , [ data ?. dbLabInstances ?. data , orgData ?. data ?. plan ] ) ;
140
-
141
131
142
132
useEffect ( ( ) => {
143
133
const unsubscribe = Store . listen ( function ( ) {
@@ -146,8 +136,6 @@ const BotSettingsForm: React.FC<BotSettingsFormProps> = (props) => {
146
136
if ( JSON . stringify ( newStoreData ) !== JSON . stringify ( data ) ) {
147
137
const auth = newStoreData ?. auth || null ;
148
138
const orgProfile = newStoreData ?. orgProfile || null ;
149
- const dbLabInstances = newStoreData ?. dbLabInstances || null ;
150
- const projectId = props . match ?. params ?. projectId || null ;
151
139
152
140
if (
153
141
auth ?. token &&
@@ -158,14 +146,6 @@ const BotSettingsForm: React.FC<BotSettingsFormProps> = (props) => {
158
146
Actions . getOrgs ( auth . token , orgId ) ;
159
147
}
160
148
161
- if (
162
- auth ?. token &&
163
- ! dbLabInstances ?. isProcessing &&
164
- ! dbLabInstances ?. error
165
- ) {
166
- Actions . getDbLabInstances ( auth . token , orgId , projectId ) ;
167
- }
168
-
169
149
setData ( newStoreData ) ;
170
150
}
171
151
} ) ;
@@ -269,13 +249,13 @@ const BotSettingsForm: React.FC<BotSettingsFormProps> = (props) => {
269
249
label = { < > < b > Public:</ b > anyone can view chats, but only team members can respond</ > }
270
250
/>
271
251
< FormControlLabel
272
- disabled = { ! isSubscriber }
252
+ disabled = { ! orgData ?. chats_private_allowed }
273
253
className = { classes . formControlLabel }
274
254
value = "private"
275
255
control = { < Radio size = "small" /> }
276
256
label = { < > < b > Private:</ b > chats are visible only to members of your organization</ > }
277
257
/>
278
- { ! isSubscriber && < Typography variant = "body2" className = { classes . unlockNote } >
258
+ { ! orgData ?. chats_private_allowed && < Typography variant = "body2" className = { classes . unlockNote } >
279
259
Unlock private conversations by either:
280
260
< ol >
281
261
< li >
0 commit comments