Skip to content

Commit

Permalink
🐛 fix: Out with Kutt.it and in with Jaguar's equivalent
Browse files Browse the repository at this point in the history
  • Loading branch information
jolzee committed Jun 9, 2020
1 parent 88c6993 commit 9430309
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const config = {
ui: {
configArea: {
shareLink: {
kuttItApiKey: "" // Optional - URL Shortener https://kutt.it/ can shortener shared links generated in the config area
jaguarLinkShortenerUrl: "" // Optional - Use Jaguar's URL Shortener for https://tinyurl.com/ It can shortener shared links generated in the config area
}
},
hideConfigMenu: false, // true = Set in production | false when in demo/development mode
Expand Down
2 changes: 1 addition & 1 deletion src/utils/buildConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let leopardConfig = {
licenseKey: config.get("liveChatInc.key"),
agentAssistServerUrl: config.get("liveChatInc.agentAssist.serverUrl")
},
kuttItKey: config.get("ui.configArea.shareLink.kuttItApiKey"),
jaguarLinkShortenerUrl: config.get("ui.configArea.shareLink.jaguarLinkShortenerUrl"),
pusherKey: "",
locationIqKey: config.get("location.locationIq.key"),
firebase: {
Expand Down
14 changes: 4 additions & 10 deletions src/views/Config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -997,18 +997,12 @@ export default {
},
createShareLinkForSolution() {
const sharableLink = createSharableLink(this.selectedSolution);
if (window.leopardConfig.kuttItKey) {
superagent
.post("https://kutt.it/api/v2/links")
.send({
target: sharableLink,
reuse: true
})
.set("X-API-KEY", window.leopardConfig.kuttItKey)
.set("Accept", "application/json")
if (window.leopardConfig.jaguarLinkShortenerUrl) {
superagent.get(window.leopardConfig.jaguarLinkShortenerUrl)
.query({ url: sharableLink })
.then(res => {
copy(
`${res.body.link}#${slugify(this.selectedSolution.name)}-${dayjs().format(
`${res.body.url}#${slugify(this.selectedSolution.name)}-${dayjs().format(
"YYYY-MM-DD"
)}`
);
Expand Down

0 comments on commit 9430309

Please sign in to comment.