Skip to content

Instantly share code, notes, and snippets.

@noili
Last active November 9, 2018 19:47
Show Gist options
  • Save noili/a5d0d0472957e18ac72f630f17b225b7 to your computer and use it in GitHub Desktop.
Save noili/a5d0d0472957e18ac72f630f17b225b7 to your computer and use it in GitHub Desktop.
WTFFF
compareOrigin(origin) {
let value;
const inMemory = JSON.parse(sessionStorage.getItem('allChipcards'));
switch (window.location.pathname.split('/').includes('callcenter')) { // extract condition to method change to iff
case false:
if (inMemory === null) {
value = this.translate.currentLang === 'es' ? 'publico' : 'public'; //breaks TDA
} else {
value = this.translate.currentLang === 'es' ? 'privado' : 'private'; //breaks TDA
}
break;
case true:
value = 'callcenter';
break;
default:
break;
}
return value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment