mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-09 06:33:03 -04:00
BetterBlockedUsers: Better Patches
This commit is contained in:
parent
c4ae044325
commit
824e65483e
2 changed files with 9 additions and 16 deletions
|
@ -123,17 +123,6 @@ const ActivityTooltip = ({ activity, application, user }: Readonly<{ activity: A
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
function getActivityApplication(activity: Activity | null) {
|
|
||||||
if (!activity) return undefined;
|
|
||||||
const { application_id } = activity;
|
|
||||||
if (!application_id) return undefined;
|
|
||||||
let application = ApplicationStore.getApplication(application_id);
|
|
||||||
if (!application && fetchedApplications.has(application_id)) {
|
|
||||||
application = fetchedApplications.get(application_id) ?? null;
|
|
||||||
}
|
|
||||||
return application ?? undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getApplicationIcons(activities: Activity[], preferSmall = false) {
|
function getApplicationIcons(activities: Activity[], preferSmall = false) {
|
||||||
const applicationIcons: ApplicationIcon[] = [];
|
const applicationIcons: ApplicationIcon[] = [];
|
||||||
const applications = activities.filter(activity => activity.application_id || activity.platform);
|
const applications = activities.filter(activity => activity.application_id || activity.platform);
|
||||||
|
|
|
@ -22,13 +22,17 @@ export default definePlugin({
|
||||||
find: '"],{numberOfBlockedUsers:',
|
find: '"],{numberOfBlockedUsers:',
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
match: /(function \S+\((\S{1,3})\).{0,100}className:_\.header,children:\[.{0,500}numberOfIgnoredUsers:\S{1,3}}\)}\)]}\))/,
|
match: /(?<=\}=(\i).*?\]\}\))/,
|
||||||
replace: "$1,$2.listType==='blocked'?$self.renderSearchInput():null"
|
replace: ",$1.listType==='blocked'?$self.renderSearchInput():null"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
match: /(function \S+\((\S{1,3})\).{0,100},\[\S{1,3},\S{1,3}]=(\S{1,3})\.useState\(\d\);)(.{0,200}children:)(\S{1,3})(\.slice\(\d,\S{1,3})/,
|
match: /(?<=\}=(\i).{0,10}(\i).useState\(.{0,1}\);)/,
|
||||||
replace: "$1let [searchResults,setSearchResults]=$3.useState([]);$self.setUpdateFunc($2,setSearchResults);$4(searchResults.length?searchResults:$5)$6"
|
replace: "let [searchResults,setSearchResults]=$2.useState([]);$self.setUpdateFunc($1,setSearchResults);"
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
match: /(usersList,children:)(\i)/,
|
||||||
|
replace: "$1(searchResults.length?searchResults:$2)"
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue