Skip to content

Commit

Permalink
fix: #14 use Template literals instead of + operator for strings (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
uneco authored and takanakahiko committed Jan 16, 2019
1 parent 29e92bc commit 4867704
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/scripts/sub_modules/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface SessionInfo {
}

export const getSessionInfo = async (teamName: string): Promise<SessionInfo | undefined> => {
const emojiCustomizeUrl = 'https://' + teamName + '.slack.com/customize/emoji'
const emojiCustomizeUrl = `https://${teamName}.slack.com/customize/emoji`
const ret = await httpGet(emojiCustomizeUrl)

if (ret.responseURL !== emojiCustomizeUrl) {
Expand Down Expand Up @@ -37,9 +37,9 @@ export const getSessionInfo = async (teamName: string): Promise<SessionInfo | un
}

export const openLoginForm = (teamName: string) => {
alert('Please login to https://' + teamName + '.slack.com')
alert(`Please login to https://${teamName}.slack.com`)
chrome.tabs.create({
url: 'https://' + teamName + '.slack.com',
url: `https://${teamName}.slack.com`,
})
}

Expand All @@ -49,7 +49,7 @@ const getXId = (sessionInfo: SessionInfo): string => {
}

export const uploadEmoji = async (teamName: string, emojiName: string, imageUrl: string, sessionInfo: SessionInfo) => {
const emojiCustomizeUrl = 'https://' + teamName + '.slack.com/api/emoji.add?_x_id=' + getXId(sessionInfo)
const emojiCustomizeUrl = `https://${teamName}.slack.com/api/emoji.add?_x_id=${getXId(sessionInfo)}`
const formData = {
mode: 'data',
name: emojiName,
Expand Down

0 comments on commit 4867704

Please sign in to comment.