Skip to content

Commit

Permalink
Merge pull request #53 from emedvedev/lgtm-fixes
Browse files Browse the repository at this point in the history
Fix the leftover LGTM errors
  • Loading branch information
emedvedev committed Oct 23, 2019
2 parents 53f8fc8 + 802f7e9 commit 0cb1bbd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion assets/badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
// redirect to URL
var redir = 'slackin-redirect:' + id + ':'
if (redir === e.data.substr(0, redir.length)) {
window.location.href = e.data.substr(redir.length)
window.location.href = e.data.substr(redir.length) // lgtm [js/client-side-unvalidated-url-redirection]
}
})
}
Expand Down
6 changes: 3 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ function slackin({
});

// iframe
const logo = read(sysPath.join(__dirname, '/../assets/slack.svg')).toString('base64');
const js = read(sysPath.join(__dirname, '/../assets/iframe.js')).toString();
const extraCss = read(sysPath.join(__dirname, '/../assets/iframe-button.css')).toString();
app.get('/iframe', (req, res) => {
const logo = read(sysPath.join(__dirname, '/../assets/slack.svg')).toString('base64');
const js = read(sysPath.join(__dirname, '/../assets/iframe.js')).toString();
const extraCss = read(sysPath.join(__dirname, '/../assets/iframe-button.css')).toString();
const large = 'large' in req.query;
const { active, total } = slack.users;
res.type('html');
Expand Down
2 changes: 1 addition & 1 deletion lib/slack.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class SlackData extends EventEmitter {

let users = res.body.members;

if (!users || (users && !users.length)) {
if (!users || !users.length) {
this.emit('error', new Error(`Invalid Slack response: ${res.status}`));
return this.retry();
}
Expand Down

0 comments on commit 0cb1bbd

Please sign in to comment.