fix(app-proxy): tell the web client its release channel (#3448)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-13 15:15:11 +02:00
1 parent 83bb9d89c8
commit d514501d57
3 files changed
+81 -1

No files matched your search

+11 -1
View File
@@ -24,6 +24,16 @@ if (!parsedBuildInfo.success) {
}
const buildInfo = parsedBuildInfo.output;
const SERVED_RELEASE_CHANNEL_META_SELECTOR = 'meta[name="fluxer-release-channel"]';
function servedReleaseChannel(): 'stable' | 'canary' | null {
if (typeof document === 'undefined') {
return null;
}
const value = document.querySelector<HTMLMetaElement>(SERVED_RELEASE_CHANNEL_META_SELECTOR)?.content;
return value === 'stable' || value === 'canary' ? value : null;
}
function clientReleaseChannel(value: (typeof buildInfo)['PUBLIC_RELEASE_CHANNEL']): 'stable' | 'canary' {
switch (value) {
case 'stable':
@@ -36,5 +46,5 @@ function clientReleaseChannel(value: (typeof buildInfo)['PUBLIC_RELEASE_CHANNEL'
export default {
PUBLIC_BUILD_VERSION: buildInfo.PUBLIC_BUILD_VERSION,
PUBLIC_RELEASE_CHANNEL: clientReleaseChannel(buildInfo.PUBLIC_RELEASE_CHANNEL),
PUBLIC_RELEASE_CHANNEL: servedReleaseChannel() ?? clientReleaseChannel(buildInfo.PUBLIC_RELEASE_CHANNEL),
} as const;