Skip to content

Commit

Permalink
code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbt365 committed Jan 30, 2025
1 parent eed10e3 commit ee0b2e1
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions src/plugins/ircColors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,18 @@ export default definePlugin({
const id = context?.message?.author?.id;
const color = calculateNameColorForUser(id);

if (settings.store.onlyApplyToColorlessUsers) {
if (!context.author.colorString) {
return color;
}

return context.author.colorString;
}
return (settings.store.onlyApplyToColorlessUsers && !context.author.colorString)
? color
: context.author.colorString;

return color;
},
calculateNameColorForListContext(context: any) {
const id = context?.user?.id;
const color = calculateNameColorForUser(id);

if (settings.store.onlyApplyToColorlessUsers) {
if (!context.colorString) {
return color;
}

return context.colorString;
}

return color;
return (settings.store.onlyApplyToColorlessUsers && !context.colorString)
? color
: context.colorString;
}

});

0 comments on commit ee0b2e1

Please sign in to comment.