disabled pwa

This commit is contained in:
subnub
2025-02-21 14:20:07 -05:00
parent f47bebff93
commit ff53449515
2 changed files with 14 additions and 20 deletions
+6 -13
View File
@@ -72,19 +72,12 @@ export const downloadFileAPI = async (fileID: string) => {
const url = `${getBackendURL()}/file-service/download/${fileID}`;
window.location.href = "https://www.google.com/";
// if (!isPwa()) {
// const link = document.createElement("a");
// document.body.appendChild(link);
// link.href = url;
// link.setAttribute("type", "hidden");
// link.setAttribute("download", "true");
// link.click();
// } else {
// alert("PWA");
// window.open(url);
// }
const link = document.createElement("a");
document.body.appendChild(link);
link.href = url;
link.setAttribute("type", "hidden");
link.setAttribute("download", "true");
link.click();
};
export const getVideoTokenAPI = async () => {
+8 -7
View File
@@ -1,7 +1,6 @@
import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
import { visualizer } from "rollup-plugin-visualizer";
import { VitePWA } from "vite-plugin-pwa";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, "./src/config/");
@@ -14,12 +13,14 @@ export default defineConfig(({ mode }) => {
plugins: [
react(),
visualizer(),
VitePWA({
registerType: "autoUpdate",
workbox: {
navigateFallbackDenylist: [/^\/file-service\/download\//],
},
}),
// Perhaps will be used in the future, currently lots of issues
// With downloading files on safari iOS PWA (who would have guessed)
// VitePWA({
// registerType: "autoUpdate",
// workbox: {
// navigateFallbackDenylist: [/^\/file-service\/download\//],
// },
// }),
],
build: {
outDir: "dist-frontend",