Chore: Feature Flags for Channels (#1010)

This commit is contained in:
Sojan Jose 2020-07-06 11:16:19 +05:30 committed by GitHub
parent b633126b35
commit e41bd56f41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 42 additions and 5 deletions

View file

@ -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)) {