all files / src/components/ blocked-summoner.js

71.43% Statements 5/7
100% Branches 0/0
0% Functions 0/2
71.43% Lines 5/7
1 statement Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21                                  
const ProviderProxy = require('riotclient-async-provider-proxy');
const components = ProviderProxy.components;
const computed = components.computed;
 
components.defineElement('lol-blocked-summoner', {
  styles: require('./blocked-summoner.styl'),
 
  computed: {
    summonerInfo: computed.if('summoner.name === ""',
        computed.resource('/lol-summoner/v1/summoners/{{summoner.id}}')),
    name: 'summonerInfo.displayName || summoner.name'
  },
 
  unblockFriend: function() {
    ProviderProxy.ajax.delete('/lol-chat/v1/blocked-players/' + this.summoner.id).then(() => {
      this.sounds.success.play();
    });
  }
});