Skip to content

Commit

Permalink
Try with pwa
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelsanchez2 committed Jul 8, 2024
1 parent bfcea4e commit 07bb17a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
1 change: 1 addition & 0 deletions public/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
importScripts("https://cdn.pushalert.co/sw-72059.js");
14 changes: 14 additions & 0 deletions src/components/router-head/router-head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ export const RouterHead = component$(() => {
const head = useDocumentHead()
const loc = useLocation()

const scriptToAdd = `
(function(d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src = "https://cdn.pushalert.co/integrate_0e441160613d873bb57688051624e3da.js";
s.parentNode.insertBefore(g, s);
}(document, "script"));
`

return (
<>
<title>{head.title}</title>
Expand All @@ -30,6 +42,8 @@ export const RouterHead = component$(() => {
{head.styles.map((s) => (
<style key={s.key} {...s.props} dangerouslySetInnerHTML={s.style} />
))}

<script type="text/javascript">{scriptToAdd}</script>
</>
)
})
18 changes: 0 additions & 18 deletions src/routes/service-worker.ts

This file was deleted.

0 comments on commit 07bb17a

Please sign in to comment.