Skip to content

Commit b005812

Browse files
committed
lint
1 parent f5627e1 commit b005812

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/api/routes/channels/#channel_id/messages/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ router.get(
149149
if ((y.user_ids || []).includes(req.user_id)) y.me = true;
150150
delete y.user_ids;
151151
});
152-
const {pomeloEnabled} = Config.get().general;
152+
const { pomeloEnabled } = Config.get().general;
153153
if (!x.author)
154154
x.author = User.create({
155155
id: "4",

src/util/entities/User.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ export class User extends BaseClass {
9999
@Column()
100100
username: string; // username max length 32, min 2 (should be configurable)
101101

102-
@Column({nullable: true})
102+
@Column({ nullable: true })
103103
global_name: string; // puyo: pomelo
104104

105-
@Column({nullable: true})
105+
@Column({ nullable: true })
106106
display_name?: string; // puyo: pomelo
107107

108108
@Column()
@@ -342,10 +342,12 @@ export class User extends BaseClass {
342342
}
343343

344344
public get handle(): string {
345-
const {pomeloEnabled} = Config.get().general;
345+
const { pomeloEnabled } = Config.get().general;
346346

347347
// if pomelo is enabled, global_name should be set
348-
return pomeloEnabled ? this.global_name as string : `${this.username}#${this.discriminator}`;
348+
return pomeloEnabled
349+
? (this.global_name as string)
350+
: `${this.username}#${this.discriminator}`;
349351
}
350352

351353
static async register({
@@ -362,13 +364,13 @@ export class User extends BaseClass {
362364
id?: string;
363365
req?: Request;
364366
}) {
365-
const {pomeloEnabled} = Config.get().general;
367+
const { pomeloEnabled } = Config.get().general;
366368

367369
// trim special uf8 control characters -> Backspace, Newline, ...
368370
username = trimSpecial(username);
369371

370372
let discriminator: string | undefined;
371-
if(pomeloEnabled) discriminator = "0";
373+
if (pomeloEnabled) discriminator = "0";
372374
else {
373375
discriminator = await User.generateDiscriminator(username);
374376
if (!discriminator) {
@@ -377,7 +379,8 @@ export class User extends BaseClass {
377379
username: {
378380
code: "USERNAME_TOO_MANY_USERS",
379381
message:
380-
req?.t("auth:register.USERNAME_TOO_MANY_USERS") || "",
382+
req?.t("auth:register.USERNAME_TOO_MANY_USERS") ||
383+
"",
381384
},
382385
});
383386
}

0 commit comments

Comments
 (0)