From 908feebcad8656a5e2091b0f27932cef9e86ee3c Mon Sep 17 00:00:00 2001 From: AOKI Yuuto Date: Wed, 16 Jan 2019 11:45:35 +0900 Subject: [PATCH] fix: #14 use Template literals instead of `+` operator for strings --- app/scripts/sub_modules/slack.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/scripts/sub_modules/slack.ts b/app/scripts/sub_modules/slack.ts index 26b1a719..40d96fb7 100644 --- a/app/scripts/sub_modules/slack.ts +++ b/app/scripts/sub_modules/slack.ts @@ -7,7 +7,7 @@ interface SessionInfo { } export const getSessionInfo = async (teamName: string): Promise => { - 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) { @@ -37,9 +37,9 @@ export const getSessionInfo = async (teamName: string): Promise { - 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`, }) } @@ -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,