Patch Fixes
Co-Authored-By: sadan4 <117494111+sadan4@users.noreply.github.com>
This commit is contained in:
parent
eddd8224c4
commit
f0ff31067c
3 changed files with 5 additions and 10 deletions
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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\""
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue