Skip to content

Commit 6ed5cbe

Browse files
authored
Fix favorite display logic in infoTxt
1 parent 8488edf commit 6ed5cbe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

js/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,11 @@ function getAppHTML(app, appInstalled, forInterface) {
512512

513513
}
514514
if (info.favourites) {
515+
515516
let percent=(info.favourites / info.installs * 100).toFixed(0);
516517
let percentText=percent>100?"More than 100% of installs":percent+"% of installs";
517-
infoTxt.push(`${info.favourites} users favourited (${percentText})`);
518+
if(!info.installs||info.installs<1) {infoTxt.push(`${info.favourites} users favourited`)}
519+
else {infoTxt.push(`${info.favourites} users favourited (${percentText})`)};
518520
appFavourites = info.favourites;
519521
}
520522
if (infoTxt.length)

0 commit comments

Comments
 (0)