Skip to content

Commit

Permalink
chore: linting and tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
jackstar12 committed Nov 27, 2024
1 parent 36bfd9a commit e279714
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
27 changes: 21 additions & 6 deletions src/chatwoot.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import { createEffect, onMount } from "solid-js";

import { config } from "./config";
import { usePayContext } from "./context/Pay";
import { createEffect, onMount } from "solid-js";

declare global {
interface Window {
chatwootSettings: {
darkMode: string;
};
chatwootSDK: {
run: (config: { websiteToken: string; baseUrl: string }) => void;
};
$chatwoot: {
setCustomAttributes: (attributes: { swapId: string }) => void;
};
}
}

export default function Chatwoot() {
onMount(() => {
Expand All @@ -14,13 +29,13 @@ export default function Chatwoot() {
script.defer = true;
script.async = true;
parent.parentNode.insertBefore(script, parent);
script.onload = function() {
script.onload = function () {
window.chatwootSettings = {
darkMode: "auto"
darkMode: "auto",
};
window.chatwootSDK.run({
websiteToken: token,
baseUrl: url
baseUrl: url,
});
};
}
Expand All @@ -31,10 +46,10 @@ export default function Chatwoot() {
createEffect(() => {
if (swap() !== null) {
window.$chatwoot.setCustomAttributes({
swapId: swap().id
swapId: swap().id,
});
}
});

return "";
}
}
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import log from "loglevel";
import { Match, Show, Switch, createSignal, onMount } from "solid-js";
import { render } from "solid-js/web";

import Chatwoot from "./chatwoot";
import Footer from "./components/Footer";
import Nav from "./components/Nav";
import Notification from "./components/Notification";
Expand All @@ -27,7 +28,6 @@ import RefundEvm from "./pages/RefundEvm";
import RefundStep from "./pages/RefundStep";
import "./style/index.scss";
import "./utils/patches";
import Chatwoot from "./chatwoot";

if ("serviceWorker" in navigator) {
void navigator.serviceWorker
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Pay.tsx
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useParams } from "@solidjs/router";
import log from "loglevel";
import { Match, Show, Switch, createResource, onCleanup, createSignal } from "solid-js";
import { Match, Show, Switch, createResource, onCleanup } from "solid-js";

import BlockExplorerLink from "../components/BlockExplorerLink";
import LoadingSpinner from "../components/LoadingSpinner";
Expand Down

0 comments on commit e279714

Please sign in to comment.