fix(ui): don't override env types

This commit is contained in:
Fuma Nama
2026-07-07 20:03:55 +08:00
parent ab09f500cb
commit 583eb75339
2 changed files with 6 additions and 18 deletions
@@ -261,21 +261,15 @@ export function ViewOptionsPopover({
);
}
declare global {
interface ImportMeta {
env?: {
BASE_URL?: unknown;
};
}
}
function withBasePath(href: string) {
// ignore external
if (href.match(/^\w+:/) || href.startsWith('//')) return href;
const basePath =
// @ts-expect-error -- vite env
typeof import.meta.env !== 'undefined' && typeof import.meta.env.BASE_URL === 'string'
? import.meta.env.BASE_URL.replace(/\/$/, '')
? // @ts-expect-error -- vite env
import.meta.env.BASE_URL.replace(/\/$/, '')
: '';
return basePath + href;
}
@@ -260,21 +260,15 @@ export function ViewOptionsPopover({
);
}
declare global {
interface ImportMeta {
env?: {
BASE_URL?: unknown;
};
}
}
function withBasePath(href: string) {
// ignore external
if (href.match(/^\w+:/) || href.startsWith('//')) return href;
const basePath =
// @ts-expect-error -- vite env
typeof import.meta.env !== 'undefined' && typeof import.meta.env.BASE_URL === 'string'
? import.meta.env.BASE_URL.replace(/\/$/, '')
? // @ts-expect-error -- vite env
import.meta.env.BASE_URL.replace(/\/$/, '')
: '';
return basePath + href;
}