Skip to content

Commit

Permalink
Merge pull request #2099 from DuckySoLucky/fixFlashBangScreen
Browse files Browse the repository at this point in the history
fix: white flash bang screen
  • Loading branch information
metalcupcake5 authored Dec 1, 2023
2 parents c210385 + 5801d12 commit 7972c5d
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,33 @@ app.all("/stats/:player/:profile?", async (req, res, next) => {
fileNameMap,
page: "stats",
},
(err, html) => {
async (err, html) => {
if (err) {
console.debug(`${debugId}: an error has occurred.`);
console.error(err);

helper.sendWebhookMessage(err, req);

const favorites = parseFavorites(req.cookies.favorite);
res.render(
"index",
{
req,
error: "An error has occurred. Please contact developers on Discord if this issue persists.",
player: playerUsername,
extra: await getExtra("index", favorites, cacheOnly),
promotion: weightedRandom(constants.PROMOTIONS),
fileHashes,
fileNameMap,
helper,
page: "index",
},
(err, html) => {
res.set("X-Debug-ID", `${debugId}`);
res.set("X-Process-Time", `${Date.now() - timeStarted}`);
res.send(html);
}
);
}

console.debug(`${debugId}: page successfully rendered. (${Date.now() - renderStart}ms)`);
Expand Down

0 comments on commit 7972c5d

Please sign in to comment.