Skip to content

Commit a01bf15

Browse files
committed
fixed coderabbit checks and bug when using typeof
1 parent 980913c commit a01bf15

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

bot/modules/dispute/commands.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ const dispute = async (ctx: MainContext) => {
9595
try {
9696
const { user } = ctx;
9797
if (
98-
ctx.state.command.args.length > 0 &&
99-
typeof ctx.state.command.args[0] !== 'undefined'
100-
) {
98+
ctx.state.command.args.length > 0 && ctx.state.command.args[0] !== 'undefined') {
10199
const params = await validateParams(ctx, 2, '\\<_order id_\\>');
102100

103101
if (!params || params.length === 0) return;
@@ -115,10 +113,8 @@ const dispute = async (ctx: MainContext) => {
115113

116114
if (orders.length > 0) {
117115
await messages.listOrdersForDispute(ctx, orders);
118-
return;
119116
} else {
120117
await ctx.reply(ctx.i18n.t('you_have_no_orders'));
121-
return;
122118
}
123119
} catch (error) {
124120
logger.error(error);

bot/modules/dispute/messages.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { getDisputeChannel, getDetailedOrder, sanitizeMD } from '../../../util';
22
import { logger } from '../../../logger';
33
import { MainContext } from '../../start';
4-
import { User } from '../../../models';
54
import { IOrder } from '../../../models/order';
65
import { UserDocument } from '../../../models/user';
76

0 commit comments

Comments
 (0)