Skip to content

Commit

Permalink
fix: iife
Browse files Browse the repository at this point in the history
  • Loading branch information
Innei committed Jul 14, 2023
1 parent 06332ad commit 4b7b8b1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
52 changes: 26 additions & 26 deletions src/app/analyze.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,34 @@ export const Analyze = () => {
return (
<script
dangerouslySetInnerHTML={{
__html:
`${function run() {
document.addEventListener(
'click',
async (e) => {
const $ = e.target as HTMLElement
const event = $.dataset.event
if (event) {
window.umami?.track(event, {
type: 'click',
})
}
},
true,
)
document.addEventListener('impression', async (e: any) => {
const detail = e.detail as {
action: TrackerAction
label: string
__html: `(${function () {
document.addEventListener(
'click',
async (e) => {
const $ = e.target as HTMLElement
const event = $.dataset.event
if (event) {
window.umami?.track(event, {
type: 'click',
})
}
window.umami?.track(detail.label, {
type: 'impression',
})
},
true,
)
document.addEventListener('impression', async (e: any) => {
const detail = e.detail as {
action: TrackerAction
label: string
}
console.log(detail, 'detail')
window.umami?.track(detail.label, {
type: 'impression',
})
}.toString()}\n` + `run();`,
})
}.toString()})();`,
}}
/>
)
Expand Down
4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const SayHi = () => {
<script
dangerouslySetInnerHTML={{
__html: `var version = "${version}";
${function info() {
(${function () {
console.log(
`%c Mix Space %c https://github.com/mx-space `,
'color: #fff; margin: 1em 0; padding: 5px 0; background: #2980b9;',
Expand All @@ -171,7 +171,7 @@ Stay hungry. Stay foolish. --Steve Jobs
if (document.firstChild?.nodeType !== Node.COMMENT_NODE) {
document.prepend(document.createComment(motto))
}
}.toString()}; info()`,
}.toString()})();`,
}}
/>
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/xlog/XLogSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const XLogSummary: FC<{
Inner = null
}

if (!cid || !data.data) {
if (!cid || !data?.data) {
Inner = null
}

Expand Down

1 comment on commit 4b7b8b1

@vercel
Copy link

@vercel vercel bot commented on 4b7b8b1 Jul 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

shiro – ./

shiro-git-main-innei.vercel.app
springtide.vercel.app
innei.in
shiro-innei.vercel.app

Please sign in to comment.