mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-17 02:17:03 -04:00
customUserColors: fix color dm list (#176)
This commit is contained in:
parent
c93e74ec0c
commit
722e2b99c0
1 changed files with 18 additions and 4 deletions
|
@ -92,16 +92,30 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
predicate: () => settings.store.dmList,
|
predicate: () => settings.store.dmList,
|
||||||
find: "!1,wrapContent",
|
find: "PrivateChannel.renderAvatar",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(nameAndDecorators,)/,
|
match: /(highlighted:\i,)/,
|
||||||
replace: "$1style:{color:$self.colorDMList(arguments[0])},"
|
replace: "$1style:{color:`${$self.colorDMList(arguments[0])}`},"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
predicate: () => settings.store.dmList,
|
||||||
|
find: "!1,wrapContent",
|
||||||
|
replacement: [
|
||||||
|
{
|
||||||
|
match: /(innerClassName:\i)(\}=\i)/,
|
||||||
|
replace: "$1,style$2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
match: /(nameAndDecorators,)/,
|
||||||
|
replace: "$1style,"
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
colorDMList(a: any): string | undefined {
|
colorDMList(a: any): string | undefined {
|
||||||
const userId = a?.subText?.props?.user?.id;
|
const userId = a?.user?.id;
|
||||||
if (!userId) return;
|
if (!userId) return;
|
||||||
const colorString = getCustomColorString(userId, true);
|
const colorString = getCustomColorString(userId, true);
|
||||||
if (colorString) return colorString;
|
if (colorString) return colorString;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue