Skip to content

Commit c15cfda

Browse files
authored
Remove unnecessary icon check
1 parent 64048b1 commit c15cfda

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

js/index.js

Lines changed: 0 additions & 24 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 = {};
@@ -1149,29 +1148,6 @@ function refreshMyApps() {
11491148
handleAppInterface(app).catch( err => {
11501149
if (err != "") showToast("Failed, "+err, "error");
11511150
});
1152-
if (icon.classList.contains("icon-favourite")) {
1153-
let favourite = SETTINGS.favourites.find(e => e == app.id);
1154-
try {
1155-
if (icon) icon.classList.toggle("icon-favourite-active", !favourite);
1156-
if (icon) icon.classList.add("favoriteAnim");
1157-
} catch (e) {}
1158-
// update visible count optimistically
1159-
try {
1160-
let countEl = button.querySelector('.fav-count');
1161-
if (countEl) {
1162-
let txt = countEl.textContent.trim();
1163-
let val = 0;
1164-
if (txt.endsWith('k')) val = Math.round(parseFloat(txt) * 1000);
1165-
else val = parseInt(txt) || 0;
1166-
val = (!favourite) ? val + 1 : Math.max(0, val - 1);
1167-
countEl.textContent = (val > 999) ? Math.round(val/1000) + 'k' : String(val);
1168-
}
1169-
} catch (e) {}
1170-
const ANIM_MS = 500;
1171-
setTimeout(() => {
1172-
try { if (icon) icon.classList.remove("favoriteAnim"); } catch (e) {}
1173-
}, ANIM_MS);
1174-
}
11751151
});
11761152
});
11771153
let nonCustomAppsToUpdate = getAppsToUpdate({excludeCustomApps:true});

0 commit comments

Comments
 (0)