mirror of
https://github.com/driftywinds/driftywinds.github.io.git
synced 2025-12-19 11:03:32 +00:00
Show latest version if the app has multiple versions
This commit is contained in:
10
js/app.js
10
js/app.js
@@ -38,6 +38,16 @@ main((json) => {
|
||||
const app = getAppWithBundleId(bundleId);
|
||||
if (!app) exit();
|
||||
|
||||
// If has multiple versions, show the latest one
|
||||
if (app.versions) {
|
||||
const latestVersion = app.versions[0];
|
||||
app.version = latestVersion.version;
|
||||
app.versionDate = latestVersion.date;
|
||||
app.versionDescription = latestVersion.localizedDescription;
|
||||
app.downloadURL = latestVersion.downloadURL;
|
||||
app.size = latestVersion.size;
|
||||
}
|
||||
|
||||
// Set tab title
|
||||
document.title = `${app.name} - ${json.name}`;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ main((json) => {
|
||||
document.title = `Apps - ${json.name}`;
|
||||
|
||||
// Sort apps in decending order of version date (newest first)
|
||||
json.apps.sort((a, b) => (new Date(b.versionDate)).valueOf() - (new Date(a.versionDate)).valueOf());
|
||||
// json.apps.sort((a, b) => (new Date(b.versionDate)).valueOf() - (new Date(a.versionDate)).valueOf());
|
||||
|
||||
// Create & insert app items
|
||||
json.apps.forEach(app => {
|
||||
|
||||
@@ -37,7 +37,7 @@ main((json) => {
|
||||
} else document.getElementById("news").remove();
|
||||
|
||||
// Sort apps in descending order of version date
|
||||
json.apps.sort((a, b) => (new Date(b.versionDate)).valueOf() - (new Date(a.versionDate)).valueOf());
|
||||
// json.apps.sort((a, b) => (new Date(b.versionDate)).valueOf() - (new Date(a.versionDate)).valueOf());
|
||||
|
||||
//
|
||||
// Featured apps
|
||||
|
||||
Reference in New Issue
Block a user