Mostly Fix AllCallTimers

This commit is contained in:
thororen1234 2025-02-07 02:43:27 -05:00
parent 77fc5bfd84
commit 85598ddf9b
4 changed files with 7 additions and 34 deletions

View file

@ -64,7 +64,6 @@ export function SpecialCard({ title, subtitle, description, cardImage, backgroun
</div>
{buttonTitle && (
<>
<Forms.FormDivider className={cl("seperator")} />
<Clickable onClick={onClick} className={cl("hyperlink")}>
<Forms.FormText className={cl("hyperlink-text")}>
{buttonTitle}

View file

@ -84,7 +84,6 @@
width: 100px;
height: 100px;
border-radius: 50%;
background-color: white;
}
.vc-special-image {

View file

@ -105,20 +105,11 @@ export default definePlugin({
settings,
patches: [
{
find: "renderPrioritySpeaker",
find: ".usernameSpeaking]",
replacement: [
{
match: /(render\(\)\{.+\}\),children:)\[(.+renderName\(\),)/,
replace: "$&,$self.showClockInjection(this),"
}
]
},
{
find: "renderPrioritySpeaker",
replacement: [
{
match: /(renderName\(\)\{.+:"")/,
replace: "$&,$self.showTextInjection(this),"
match: /function\(\)\{.+:""(?=.*?userId:(\i))/,
replace: "$&,$self.renderTimer($1.id),"
}
]
}
@ -225,26 +216,10 @@ export default definePlugin({
}
},
showClockInjection(property: { props: { user: { id: string; }; }; }) {
if (settings.store.showWithoutHover) {
return "";
}
return this.showInjection(property);
},
showTextInjection(property: { props: { user: { id: string; }; }; }) {
renderTimer(userId: string) {
if (!settings.store.showWithoutHover) {
return "";
}
return this.showInjection(property);
},
showInjection(property: { props: { user: { id: string; }; }; }) {
const userId = property.props.user.id;
return this.renderTimer(userId);
},
renderTimer(userId: string) {
// get the user join time from the users object
const joinTime = userJoinTimes.get(userId);
if (!joinTime?.time) {

View file

@ -124,11 +124,11 @@ export default definePlugin({
},
// Voice Users
{
find: "renderPrioritySpeaker(){",
find: ".usernameSpeaking]",
replacement: [
{
match: /renderName\(\){.+?usernameSpeaking\]:.+?(?=children)/,
replace: "$&style:$self.getColorStyle(this?.props?.user?.id,this?.props?.guildId),"
match: /usernameSpeaking\]:.+?(?=children)(?=.*?userId:(\i))(?=.*?contextGuildId:(\i))/,
replace: "$&style:$self.getColorStyle($1.id,$2),"
}
],
predicate: () => settings.store.voiceUsers