Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 committed Sep 24, 2024
1 parent 6d991db commit b502239
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 32 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/components/pwa-badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useRegisterSW } from "virtual:pwa-register/react";
import Button from "../ui/button";

const isPWA = window.matchMedia("(display-mode: standalone)").matches;
const enableReload = false;
const enableReload = true;

export default function PWABadge() {
// Periodic sync is disabled, change the value to enable it, the period is in milliseconds
Expand Down
5 changes: 2 additions & 3 deletions apps/web/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ReactDOM from "react-dom/client";
import "./index.css";
import { RouterProvider } from "react-router-dom";
import { router } from "./router.tsx";
// import PWABadge from "./components/pwa-badge.tsx";
import PWABadge from "./components/pwa-badge.tsx";

import * as Sentry from "@sentry/react";

Expand All @@ -18,11 +18,10 @@ Sentry.init({
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
});
console.log("Hello World");

ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<RouterProvider router={router} />
{/* <PWABadge /> */}
<PWABadge />
</React.StrictMode>,
);
56 changes: 28 additions & 28 deletions apps/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,41 @@ import { sentryVitePlugin } from "@sentry/vite-plugin";

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
// import { VitePWA } from "vite-plugin-pwa";
import { VitePWA } from "vite-plugin-pwa";

// https://vitejs.dev/config/
export default defineConfig({
base: "",

plugins: [
react(),
// VitePWA({
// registerType: "prompt",
// injectRegister: false,
// manifestFilename: "manifest.json",
// pwaAssets: {
// disabled: false,
// config: true,
// },
// manifest: {
// name: "Helix Bridge",
// short_name: "HelixBridge",
// description: "Secure, fast, and low-cost cross-chain crypto transfers",
// theme_color: "#00141D",
// background_color: "#00141D",
// },
// workbox: {
// globPatterns: ["**/*.{js,css,html,svg,png,ico}"],
// cleanupOutdatedCaches: true,
// clientsClaim: true,
// },
// devOptions: {
// enabled: false,
// navigateFallback: "index.html",
// suppressWarnings: true,
// type: "module",
// },
// }),
VitePWA({
registerType: "prompt",
injectRegister: false,
manifestFilename: "manifest.json",
pwaAssets: {
disabled: false,
config: true,
},
manifest: {
name: "Helix Bridge",
short_name: "HelixBridge",
description: "Secure, fast, and low-cost cross-chain crypto transfers",
theme_color: "#00141D",
background_color: "#00141D",
},
workbox: {
globPatterns: ["**/*.{js,css,html,svg,png,ico}"],
cleanupOutdatedCaches: true,
clientsClaim: true,
},
devOptions: {
enabled: false,
navigateFallback: "index.html",
suppressWarnings: true,
type: "module",
},
}),
sentryVitePlugin({
org: "helix-ck",
project: "javascript-react",
Expand Down

0 comments on commit b502239

Please sign in to comment.