From 6cbeb4ddf95322233bb22d16197bbac9831e47b7 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Thu, 29 May 2025 21:46:45 -0400 Subject: [PATCH] Add support for offline lottie In air gapped, lotties won't load because the WASM player is fetched from CDN. This PR bundles the player so we can fetch it directly from file system --- frontend/src/main.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 779c21bd8..87b7682dd 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -2,6 +2,8 @@ import { StrictMode } from "react"; import ReactDOM from "react-dom/client"; import { createRouter, RouterProvider } from "@tanstack/react-router"; import NProgress from "nprogress"; +import { setWasmUrl } from '@lottiefiles/dotlottie-react'; +import lottieWasmUrl from '@lottiefiles/dotlottie-web/dist/dotlottie-player.wasm?url'; import { ContentLoader } from "./components/v2"; import { queryClient } from "./hooks/api/reactQuery"; @@ -22,6 +24,9 @@ import "./translation"; // have a look at the Quick start guide // for passing in lng and translations on init/ +// Configure Lottie player to use local WASM file +setWasmUrl(lottieWasmUrl); + // Create a new router instance NProgress.configure({ showSpinner: false });