From ad2dabcc962c98a2b87cb78658159523ca1c82ff Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Sat, 29 Jun 2024 11:43:15 +0530 Subject: [PATCH] Fix again --- web/packages/next/origins.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/packages/next/origins.ts b/web/packages/next/origins.ts index 8200df95a3..13937f42c0 100644 --- a/web/packages/next/origins.ts +++ b/web/packages/next/origins.ts @@ -1,4 +1,5 @@ import { getKV, setKV } from "@/next/kv"; +import { inWorker } from "./env"; /** * Return the origin (scheme, host, port triple) that should be used for making @@ -36,7 +37,7 @@ export const apiURL = async (path: string) => (await apiOrigin()) + path; */ export const customAPIOrigin = async () => { let origin = await getKV("apiOrigin"); - if (!origin) { + if (!origin && !inWorker()) { // TODO: Migration of apiOrigin from local storage to indexed DB // Remove me after a bit (27 June 2024). const legacyOrigin = localStorage.getItem("apiOrigin");