Skip to content

Commit

Permalink
Fixing lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
TeaByte committed Feb 18, 2024
1 parent 277a61d commit 6735eb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Head } from "$fresh/runtime.ts";
import Footer from "../components/Footer.tsx";
import IconArrowBigRightLines from "https://deno.land/x/[email protected]/tsx/arrow-big-right-lines.tsx";
import AboutIcons from "@/components/AboutIcons.tsx";
import CodeBox from "@/islands/CodeBox.tsx";
// import CodeBox from "@/islands/CodeBox.tsx";

export default function IndexPage() {
return (
Expand Down
8 changes: 5 additions & 3 deletions static/JavaScript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ if (storedTheme) {
}

// To check if the browser supports oklch ( is new browser )
(function supportsOklch() {
function supportsOklch() {
const testElement = document.createElement('div');
testElement.style.color = 'oklch(var(--b3))';
document.body.appendChild(testElement);
const style = window.getComputedStyle(testElement).color;
const style = globalThis.getComputedStyle(testElement).color;
document.body.removeChild(testElement);
return style.indexOf('oklch') !== -1;
})()
}

// PWA install button
let installPrompt = null;
Expand All @@ -25,6 +25,7 @@ document.addEventListener('DOMContentLoaded', () => {
document.getElementById('old-check').style.display = 'block';
}

// Check if browser supports PWA
if ('serviceWorker' in navigator && 'PushManager' in globalThis) {
globalThis.addEventListener('beforeinstallprompt', (e) => {
console.log('beforeinstallprompt fired');
Expand All @@ -50,6 +51,7 @@ document.addEventListener('DOMContentLoaded', () => {
});
}

// Hide the install button
function disableInAppInstallPrompt() {
installPrompt = null;
document.getElementById('install-pwa').style.display = 'none';
Expand Down

0 comments on commit 6735eb3

Please sign in to comment.