mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +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';
|
import { assertSecret } from './assertSecret';
|
||||||
|
|
||||||
export function asset(path: string) {
|
export function asset(path: string) {
|
||||||
return assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH) === 'main'
|
return `${assertSecret(import.meta.env.PUBLIC_ASSET_BASE)}/${path}`;
|
||||||
? `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}`;
|
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@ import { LinkI18n } from './LinkI18n';
|
|||||||
import { LocaleSwitcherThemeWrapper } from './LocaleSwitcher';
|
import { LocaleSwitcherThemeWrapper } from './LocaleSwitcher';
|
||||||
|
|
||||||
const gameDefinitions = await fetchGameDefinitions();
|
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 locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
||||||
const strings = getStrings(locale);
|
const strings = getStrings(locale);
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ const strings = getStrings(locale);
|
|||||||
toolsFiltered.map((tool) => {
|
toolsFiltered.map((tool) => {
|
||||||
const unavailableOnBranch = tool.branches?.every(
|
const unavailableOnBranch = tool.branches?.every(
|
||||||
(branch) =>
|
(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 selected = Astro.url.pathname.includes(`/${tool.id}`);
|
||||||
const toolStrings =
|
const toolStrings =
|
||||||
@@ -211,7 +211,7 @@ const strings = getStrings(locale);
|
|||||||
toolsFiltered.map((tool) => {
|
toolsFiltered.map((tool) => {
|
||||||
const unavailableOnBranch = tool.branches?.every(
|
const unavailableOnBranch = tool.branches?.every(
|
||||||
(branch) =>
|
(branch) =>
|
||||||
branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH),
|
branch !== assertSecret(import.meta.env.PUBLIC_BRANCH),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (unavailableOnBranch) return null;
|
if (unavailableOnBranch) return null;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export function Plugs() {
|
|||||||
function Content() {
|
function Content() {
|
||||||
const promoteOpentest =
|
const promoteOpentest =
|
||||||
assertSecret(import.meta.env.PUBLIC_PROMOTE_OPENTEST) === 'true' &&
|
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];
|
const promotions = [promoteOpentest];
|
||||||
|
|
||||||
if (promotions.every((promotion) => !promotion)) return null;
|
if (promotions.every((promotion) => !promotion)) return null;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export function CalloutsSection() {
|
|||||||
const tank = Duel.use((state) => state.protagonist.tank);
|
const tank = Duel.use((state) => state.protagonist.tank);
|
||||||
const mutateTankopediaPersistent = TankopediaPersistent.useMutation();
|
const mutateTankopediaPersistent = TankopediaPersistent.useMutation();
|
||||||
const promoteAeson =
|
const promoteAeson =
|
||||||
assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH) === 'preview';
|
assertSecret(import.meta.env.PUBLIC_BRANCH) === 'preview';
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
mutateTankopediaPersistent((draft) => {
|
mutateTankopediaPersistent((draft) => {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ interface Props {
|
|||||||
|
|
||||||
const { tool } = Astro.props;
|
const { tool } = Astro.props;
|
||||||
const disabled = tool.branches?.every(
|
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 { locale } = Astro.params;
|
||||||
const strings = getStrings(locale);
|
const strings = getStrings(locale);
|
||||||
@@ -108,7 +108,7 @@ const toolStrings =
|
|||||||
disabled ? (
|
disabled ? (
|
||||||
<>
|
<>
|
||||||
Unavailable on{' '}
|
Unavailable on{' '}
|
||||||
<Code>{assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH)}</Code>
|
<Code>{assertSecret(import.meta.env.PUBLIC_BRANCH)}</Code>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
toolStrings.description
|
toolStrings.description
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export function resolveBranchName(locale: string = DEFAULT_LOCALE) {
|
|||||||
if (!(locale in STRINGS)) throw new Error(`Unsupported locale: ${locale}`);
|
if (!(locale in STRINGS)) throw new Error(`Unsupported locale: ${locale}`);
|
||||||
|
|
||||||
const strings = STRINGS[locale as SupportedLocale];
|
const strings = STRINGS[locale as SupportedLocale];
|
||||||
const secret = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
const secret = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
assertSecret(import.meta.env.MODE) === 'development' &&
|
assertSecret(import.meta.env.MODE) === 'development' &&
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import {
|
|||||||
import { getStrings } from '../../core/i18n/getStrings';
|
import { getStrings } from '../../core/i18n/getStrings';
|
||||||
import BaseLayout from '../../layouts/BaseLayout.astro';
|
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 MODE = assertSecret(import.meta.env.MODE);
|
||||||
const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
||||||
const strings = getStrings(Astro.params.locale);
|
const strings = getStrings(Astro.params.locale);
|
||||||
|
|||||||
Reference in new issue
Block a user