Patch Fixes

Co-Authored-By: sadan4 <117494111+sadan4@users.noreply.github.com>
This commit is contained in:
thororen1234 2025-08-05 00:14:59 -04:00
parent eddd8224c4
commit f0ff31067c
No known key found for this signature in database
3 changed files with 5 additions and 10 deletions

View file

@ -34,6 +34,7 @@ export function transform(state?: string): string | JSX.Element {
const baseFormat = state ?? format;
const replaced = baseFormat
.replace(/{discordName}/g, "Discord")
.replace(/{buildChannel}/g, buildChannel)
.replace(/{buildNumber}/g, BUILD_NUMBER)
.replace(/{buildHash}/g, VERSION_HASH.slice(0, 9))

View file

@ -72,7 +72,7 @@ export default definePlugin({
// Insert a Scan QR Code button in the Settings sheet
{
find: "useGenerateUserSettingsSections",
find: ".isInputProfileCustom()",
replacement: {
match: /\.CONNECTIONS/,
replace: "$&,\"SCAN_QR_CODE\""

View file

@ -361,20 +361,14 @@ export default definePlugin({
replacement: [
{
// Create a variable for the channel prop
match: /users:\i,maxUsers:\i.+?}=(\i).*?;/,
replace: (m, props) => `${m}let{shcChannel}=${props};`
match: /(function \i\(\i\)\{)([^}]+?hideOverflowCount)/,
replace: "$1let {shcChannel}=arguments[0];$2"
},
{
// Make Discord always render the plus button if the component is used inside the HiddenChannelLockScreen
match: /\i>0(?=&&.{0,30}Math.min)/,
match: /\i>0(?=&&!\i&&!\i)/,
replace: m => `($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)?true:${m})`
},
{
// Prevent Discord from overwriting the last children with the plus button
// if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen
match: /(?<=\i\.length-)1(?=\]=.{0,60}renderPopout)(?<=(\i)=\i\.length-\i.+?)/,
replace: (_, amount) => `($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)&&${amount}<=0?0:1)`
},
{
// Show only the plus text without overflowed children amount
// if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen