Skip to content

Commit

Permalink
db-tabulator: skip /footer when in silent mode
Browse files Browse the repository at this point in the history
!web-restart
siddharthvp committed Mar 10, 2024
1 parent b446249 commit af2a02f
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions db-tabulator/app.ts
Original file line number Diff line number Diff line change
@@ -106,6 +106,7 @@ export class Query {
removeUnderscores?: number[];
hiddenColumns?: number[];
interval?: number;
silent?: boolean;
} = {};

isValid = true;
@@ -236,6 +237,7 @@ export class Query {
}
}

this.config.silent = !!this.getTemplateValue('silent');
}

async runQuery() {
@@ -534,14 +536,15 @@ export class Query {
return (pageNumber <= 1 ? warningsText : '') +
db.makeReplagMessage(2) +
tableText + '\n' +
'----\n' +
Mwn.template('Database report/footer', {
count: result.length,
page: pageNumber && String(pageNumber),
num_pages: pageNumber && String(this.numPages),
query_runtime: this.queryRuntime,
last_updated: new bot.date().format('D MMMM YYYY HH:mm') + ' (UTC)',
});
(this.config.silent ? '' : '----\n' +
Mwn.template('Database report/footer', {
count: result.length,
page: pageNumber && String(pageNumber),
num_pages: pageNumber && String(this.numPages),
query_runtime: this.queryRuntime,
last_updated: new bot.date().format('D MMMM YYYY HH:mm') + ' (UTC)',
})
);
}

async save(queryResult: string | string[], isError = false) {

0 comments on commit af2a02f

Please sign in to comment.