Fix again

This commit is contained in:
Manav Rathi
2024-06-29 11:43:15 +05:30
parent 8b16b4632f
commit ad2dabcc96

View File

@@ -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");