Skip to content

Commit

Permalink
chore: address review
Browse files Browse the repository at this point in the history
  • Loading branch information
jackstar12 committed Nov 27, 2024
1 parent 4ce904a commit c5227df
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/chatwoot.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createEffect, onMount } from "solid-js";
import log from "loglevel";
import { onMount } from "solid-js";

import { config } from "./config";
import { usePayContext } from "./context/Pay";

declare global {
interface Window {
Expand Down Expand Up @@ -38,16 +38,8 @@ export default function Chatwoot() {
baseUrl: url,
});
};
}
});

const { swap } = usePayContext();

createEffect(() => {
if (swap() !== null) {
window.$chatwoot.setCustomAttributes({
swapId: swap().id,
});
} else {
log.warn("Chatwoot token or url not set");
}
});

Expand Down

0 comments on commit c5227df

Please sign in to comment.