mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
Merge branch 'main' into ue4
This commit is contained in:
commit
bc9f7054e1
8 files changed
+10
-18
No files matched your search
@@ -1,13 +1,5 @@
|
||||
import { assertSecret } from './assertSecret';
|
||||
|
||||
export function asset(path: string) {
|
||||
return assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH) === 'main'
|
||||
? `https://${assertSecret(
|
||||
import.meta.env.PUBLIC_ASSET_FAST_USER,
|
||||
)}.github.io/${assertSecret(
|
||||
import.meta.env.PUBLIC_ASSET_FAST_REPO,
|
||||
)}/${path}`
|
||||
: `https://raw.githubusercontent.com/${assertSecret(
|
||||
import.meta.env.PUBLIC_ASSET_REPO,
|
||||
)}/${assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH)}/${path}`;
|
||||
return `${assertSecret(import.meta.env.PUBLIC_ASSET_BASE)}/${path}`;
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import { LinkI18n } from './LinkI18n';
|
||||
import { LocaleSwitcherThemeWrapper } from './LocaleSwitcher';
|
||||
|
||||
const gameDefinitions = await fetchGameDefinitions();
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||
const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
||||
const strings = getStrings(locale);
|
||||
---
|
||||
|
||||
@@ -139,7 +139,7 @@ const strings = getStrings(locale);
|
||||
toolsFiltered.map((tool) => {
|
||||
const unavailableOnBranch = tool.branches?.every(
|
||||
(branch) =>
|
||||
branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH),
|
||||
branch !== assertSecret(import.meta.env.PUBLIC_BRANCH),
|
||||
);
|
||||
const selected = Astro.url.pathname.includes(`/${tool.id}`);
|
||||
const toolStrings =
|
||||
@@ -211,7 +211,7 @@ const strings = getStrings(locale);
|
||||
toolsFiltered.map((tool) => {
|
||||
const unavailableOnBranch = tool.branches?.every(
|
||||
(branch) =>
|
||||
branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH),
|
||||
branch !== assertSecret(import.meta.env.PUBLIC_BRANCH),
|
||||
);
|
||||
|
||||
if (unavailableOnBranch) return null;
|
||||
|
||||
@@ -14,7 +14,7 @@ export function Plugs() {
|
||||
function Content() {
|
||||
const promoteOpentest =
|
||||
assertSecret(import.meta.env.PUBLIC_PROMOTE_OPENTEST) === 'true' &&
|
||||
assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH) !== 'opentest';
|
||||
assertSecret(import.meta.env.PUBLIC_BRANCH) !== 'opentest';
|
||||
const promotions = [promoteOpentest];
|
||||
|
||||
if (promotions.every((promotion) => !promotion)) return null;
|
||||
|
||||
@@ -15,7 +15,7 @@ export function CalloutsSection() {
|
||||
const tank = Duel.use((state) => state.protagonist.tank);
|
||||
const mutateTankopediaPersistent = TankopediaPersistent.useMutation();
|
||||
const promoteAeson =
|
||||
assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH) === 'preview';
|
||||
assertSecret(import.meta.env.PUBLIC_BRANCH) === 'preview';
|
||||
|
||||
useEffect(() => {
|
||||
mutateTankopediaPersistent((draft) => {
|
||||
|
||||
@@ -12,7 +12,7 @@ interface Props {
|
||||
|
||||
const { tool } = Astro.props;
|
||||
const disabled = tool.branches?.every(
|
||||
(branch) => branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH),
|
||||
(branch) => branch !== assertSecret(import.meta.env.PUBLIC_BRANCH),
|
||||
);
|
||||
const { locale } = Astro.params;
|
||||
const strings = getStrings(locale);
|
||||
@@ -108,7 +108,7 @@ const toolStrings =
|
||||
disabled ? (
|
||||
<>
|
||||
Unavailable on{' '}
|
||||
<Code>{assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH)}</Code>
|
||||
<Code>{assertSecret(import.meta.env.PUBLIC_BRANCH)}</Code>
|
||||
</>
|
||||
) : (
|
||||
toolStrings.description
|
||||
|
||||
@@ -5,7 +5,7 @@ export function resolveBranchName(locale: string = DEFAULT_LOCALE) {
|
||||
if (!(locale in STRINGS)) throw new Error(`Unsupported locale: ${locale}`);
|
||||
|
||||
const strings = STRINGS[locale as SupportedLocale];
|
||||
const secret = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
||||
const secret = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||
|
||||
if (
|
||||
assertSecret(import.meta.env.MODE) === 'development' &&
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
import { getStrings } from '../../core/i18n/getStrings';
|
||||
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||
const MODE = assertSecret(import.meta.env.MODE);
|
||||
const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
||||
const strings = getStrings(Astro.params.locale);
|
||||
|
||||
Reference in new issue
Block a user