mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
Chore: Feature Flags for Channels (#1010)
This commit is contained in:
@@ -40,10 +40,23 @@ export default {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
enabledFeatures: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
isActive(channel) {
|
||||
return ['facebook', 'website', 'twitter', 'twilio'].includes(channel);
|
||||
if (Object.keys(this.enabledFeatures) === 0) {
|
||||
return false;
|
||||
}
|
||||
if (channel === 'facebook') {
|
||||
return this.enabledFeatures.channel_facebook;
|
||||
}
|
||||
if (channel === 'twitter') {
|
||||
return this.enabledFeatures.channel_facebook;
|
||||
}
|
||||
return ['website', 'twilio'].includes(channel);
|
||||
},
|
||||
onItemClick() {
|
||||
if (this.isActive(this.channel)) {
|
||||
|
||||
Reference in New Issue
Block a user