DiscordDevBanner: Cleanup

This commit is contained in:
thororen1234 2025-08-03 21:47:31 -04:00
parent 14b59146eb
commit ec575062b9
No known key found for this signature in database
3 changed files with 4 additions and 13 deletions

View file

@ -30,9 +30,7 @@ export function transform(state?: string): string | JSX.Element {
const { RELEASE_CHANNEL, BUILD_NUMBER, VERSION_HASH } = window.GLOBAL_ENV;
const buildChannel = names[RELEASE_CHANNEL] || RELEASE_CHANNEL.charAt(0).toUpperCase() + RELEASE_CHANNEL.slice(1);
const { chromiumVersion, electronVersion } = SettingsPlugin;
const format =
settings.store.format ??
"{devBannerIcon} {buildChannel} {buildNumber} ({buildHash}) | {equicordIcon} {equicordName} {equicordVersion} ({equicordHash})";
const format = settings.store.format ?? "{devBannerIcon} {buildChannel} {buildNumber} ({buildHash}) | {equicordIcon} {equicordName} {equicordVersion} ({equicordHash})";
const baseFormat = state ?? format;
const replaced = baseFormat
@ -95,10 +93,6 @@ export default definePlugin({
match: '"staging"===window.GLOBAL_ENV.RELEASE_CHANNEL',
replace: "true"
},
{
match: /(\i=\(\)=>)\(.*?\}\);/,
replace: "$1null;"
},
{
match: /children:\[.*?\{\}\)\]/g,
replace: "children:$self.transform()"

View file

@ -59,15 +59,14 @@ function FormatSetting(setValue) {
return (
<Forms.FormSection>
<Forms.FormTitle>Custom Format</Forms.FormTitle>
<Forms.FormText className={"vc-discord-dev-banner"}>
<Forms.FormText className={"vc-discord-dev-banner-text"}>
The format to transform the build number to. You can use the following placeholders:
{"\n\n"}
{placeholderInfo.join("\n")}
{"\n\n"}
</Forms.FormText>
<Forms.FormText className="vc-discord-dev-banner">Preview:</Forms.FormText>
<Forms.FormText className="vc-discord-dev-banner-text">Preview:</Forms.FormText>
<Forms.FormText style={{ padding: "2px" }}>{preview}</Forms.FormText>
<textarea
className="vc-discord-dev-banner-input"
@ -88,8 +87,6 @@ function FormatSetting(setValue) {
}}
/>
{error && (
<Forms.FormText className={"vc-discord-dev-banner-error"}>{error}</Forms.FormText>
)}

View file

@ -1,4 +1,4 @@
.vc-discord-dev-banner {
.vc-discord-dev-banner-text {
white-space: pre-wrap;
padding: 2px;
}