From c4d98628608c2d507f90a4090cd54b13f13765db Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Mon, 11 Mar 2024 15:42:08 +0100 Subject: [PATCH] assign the cover url to a const --- main.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index 4d91f9a..8a23942 100644 --- a/main.js +++ b/main.js @@ -104,13 +104,12 @@ function startOsuStatus() { : " "; if ("beatmap" in currentStatus.player_status.status) { const setId = currentStatus.player_status.status.beatmap.set_id; + const coverImage = + `https://assets.ppy.sh/beatmaps/${setId}/covers/list@2x.jpg`; if ( - checkImageExists( - `https://assets.ppy.sh/beatmaps/${setId}/covers/list@2x.jpg`, - ) + checkImageExists(coverImage) ) { - largeImageKey = - `https://assets.ppy.sh/beatmaps/${setId}/covers/list@2x.jpg`; + largeImageKey = coverImage; } }