Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
switchToCabal(plaintextKey){
/** @type {CabalClient} */
var cabalClient = this.cabalClient
this.loading = true;
var key = plaintextKey ? CabalClient.scrubKey(plaintextKey) : null
if (!key){
cabalClient.createCabal().then(cabalDetails=>{
if (this.cabalKeys.indexOf(cabalDetails.key) == -1){
this.cabalKeys.push(cabalDetails.key)
}
cabalClient.focusCabal(cabalDetails.key)
this.activeCabal = details
this.loading=false
details.on('update', this.uiUpdate) // TODO don't duplicate these listeners
})
} else {
var details = null
var spent = false
if (this.cabalKeys.indexOf(plaintextKey) == -1){
this.cabalKeys.push(plaintextKey)
removeCabal(plaintextKey){
this.cabalClient.removeCabal(CabalClient.scrubKey(plaintextKey))
this.cabalKeys.splice(this.cabalKeys.indexOf(plaintextKey),1)
},
setChannel(channelName){
key:function(){
return Client.scrubKey(this.plaintextKey)
}
}