Skip to content

Commit d81eca2

Browse files
authored
Update index.js
1 parent b10e2e5 commit d81eca2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

js/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//FAV WITH PILL AND ANIM
21
let appJSON = []; // List of apps and info from apps.json
32
let appSortInfo = {}; // list of data to sort by, from appdates.csv { created, modified }
43
let appCounts = {};
@@ -503,13 +502,16 @@ function handleAppInterface(app) {
503502
}
504503

505504
function changeAppFavourite(favourite, app,refresh=true) {
505+
let inDatabase=SETTINGS.appsFavoritedThisSession.find(obj => obj.id === app.id);
506+
506507
if (favourite) {
507508
SETTINGS.appsFavoritedThisSession.push({"id":app.id,"favs":appSortInfo[app.id]&&appSortInfo[app.id].favourites?appSortInfo[app.id].favourites:0});
508509
SETTINGS.favourites = SETTINGS.favourites.concat([app.id]);
509510
} else {
510511
SETTINGS.appsFavoritedThisSession = SETTINGS.appsFavoritedThisSession.filter(obj => obj.id !== app.id);
511512
SETTINGS.favourites = SETTINGS.favourites.filter(e => e != app.id);
512513
}
514+
513515
saveSettings();
514516
if(refresh) {
515517
refreshLibrary();
@@ -603,7 +605,7 @@ function getAppHTML(app, appInstalled, forInterface) {
603605
// Always show a count (0 if none) and format large numbers with 'k'
604606
let n = (cnt && typeof cnt === 'number') ? cnt : 0;
605607
let txt = (n > 999) ? Math.round(n/1000)+"k" : n;
606-
return `<span class="fav-count">${txt}</span>`;
608+
return `<span class="fav-count" style="margin-left:-1em;margin-right:0.5em">${txt}</span>`;
607609
};
608610

609611
let html = `<div class="tile column col-6 col-sm-12 col-xs-12 app-tile">
@@ -612,7 +614,7 @@ function getAppHTML(app, appInstalled, forInterface) {
612614
</div>
613615
<div class="tile-content">
614616
<p class="tile-title text-bold"><a name="${appurl}"></a>${escapeHtml(app.name)} ${versionInfo}</p>
615-
<p class="tile-subtitle">${getAppDescription(app)}${app.readme?`<br/>${readme}`:""}</p>
617+
<p class="tile-subtitle">${getAppDescription(app)}${app.readme?`</br>${readme}`:""}</p>
616618
${githubLink}
617619
<a href="${appurl}" class="link-copy-url" appid="${app.id}" title="Copy link to app" style="position:absolute;top: 56px;left: -24px;"><img src="core/img/copy-icon.png" alt="Copy link to app"/></a>
618620
</div>

0 commit comments

Comments
 (0)