mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 04:55:42 +09:00
fix(app): treat a black instance theme colour as unset (#3502)
This commit is contained in:
1 parent
41da6b5985
commit
b9ea837c75
5 files changed
+34
-20
No files matched your search
@@ -57,6 +57,7 @@ import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
|
||||
import {resolveSmtpTlsMode, type SmtpTlsMode, smtpTlsModeFromSecure} from '@fluxer/constants/src/SmtpConstants';
|
||||
import {ConflictError} from '@fluxer/errors/src/domains/core/ConflictError';
|
||||
import {ServiceUnavailableError} from '@fluxer/errors/src/domains/core/ServiceUnavailableError';
|
||||
import {normalizeThemeColor} from '@fluxer/instance_bootstrap/src/ThemeColor';
|
||||
import {
|
||||
InstanceConfigResponse,
|
||||
InstanceConfigUpdateRequest,
|
||||
@@ -414,14 +415,6 @@ function normalizeOptionalPublicString(value: string | null | undefined, fallbac
|
||||
return value === undefined ? fallback : normalizeOptionalString(value);
|
||||
}
|
||||
|
||||
function normalizeThemeColor(value: unknown): string | null {
|
||||
const match = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(normalizeOptionalString(value) ?? '');
|
||||
if (match === null) return null;
|
||||
const digits = match[1].toLowerCase();
|
||||
const color = `#${digits.length === 3 ? digits.replace(/./g, '$&$&') : digits}`;
|
||||
return color === '#000000' ? null : color;
|
||||
}
|
||||
|
||||
function getDefaultPremiumProductName(): string {
|
||||
return Config.instance.selfHosted ? 'Premium' : 'Plutonium';
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user