-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add chatwoot, replace discord as main help link
- Loading branch information
1 parent
93464ac
commit d3933f4
Showing
8 changed files
with
60 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { config } from "./config"; | ||
import { usePayContext } from "./context/Pay"; | ||
import { createEffect, onMount } from "solid-js"; | ||
|
||
export default function Chatwoot() { | ||
onMount(() => { | ||
const token = import.meta.env.VITE_CHATWOOT_TOKEN; | ||
const url = config.chatwootUrl; | ||
if (token !== undefined && url !== undefined) { | ||
const tag = "script"; | ||
const script = document.createElement(tag); | ||
const parent = document.getElementsByTagName(tag)[0]; | ||
script.src = url + "/packs/js/sdk.js"; | ||
script.defer = true; | ||
script.async = true; | ||
parent.parentNode.insertBefore(script, parent); | ||
script.onload = function() { | ||
window.chatwootSettings = { | ||
darkMode: "auto" | ||
}; | ||
window.chatwootSDK.run({ | ||
websiteToken: token, | ||
baseUrl: url | ||
}); | ||
}; | ||
} | ||
}); | ||
|
||
try { | ||
const { swap } = usePayContext(); | ||
|
||
createEffect(() => { | ||
if (swap() !== null) { | ||
window.$chatwoot.setCustomAttributes({ | ||
id: swap().id | ||
}); | ||
} | ||
}); | ||
} catch (error) { | ||
Check failure on line 39 in src/chatwoot.ts GitHub Actions / ci
Check failure on line 39 in src/chatwoot.ts GitHub Actions / ci
Check failure on line 39 in src/chatwoot.ts GitHub Actions / ci
|
||
} | ||
|
||
return ""; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ const defaults = { | |
|
||
loglevel: "info" as log.LogLevelDesc, | ||
defaultLanguage: "en", | ||
supportUrl: "https://support.boltz.exchange/hc/center", | ||
discordUrl: "https://discord.gg/QBvZGcW", | ||
twitterUrl: "https://twitter.com/boltzhq", | ||
githubUrl: "https://github.com/BoltzExchange", | ||
|
@@ -24,6 +25,7 @@ const defaults = { | |
telegramUrl: "https://t.me/boltzhq", | ||
email: "[email protected]", | ||
dnsOverHttps: "https://1.1.1.1/dns-query", | ||
chatwootUrl: "https://support.boltz.exchange", | ||
}; | ||
|
||
type Asset = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters