Skip to content

Commit

Permalink
fix: crash when checking for new dashboard release without internet c…
Browse files Browse the repository at this point in the history
…onnection (#2015)
  • Loading branch information
visualfanatic authored Jan 23, 2022
1 parent d1a5ff4 commit 8c36e69
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Parse-Dashboard/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ var fs = require('fs');
const currentVersionFeatures = require('../package.json').parseDashboardFeatures;

var newFeaturesInLatestVersion = [];
packageJson('parse-dashboard', { version: 'latest', fullMetadata: true }).then(latestPackage => {
if (latestPackage.parseDashboardFeatures instanceof Array) {
newFeaturesInLatestVersion = latestPackage.parseDashboardFeatures.filter(feature => {
return currentVersionFeatures.indexOf(feature) === -1;
});
}
});
packageJson('parse-dashboard', { version: 'latest', fullMetadata: true })
.then(latestPackage => {
if (latestPackage.parseDashboardFeatures instanceof Array) {
newFeaturesInLatestVersion = latestPackage.parseDashboardFeatures.filter(feature => {
return currentVersionFeatures.indexOf(feature) === -1;
});
}
})
.catch(() => {
// In case of a failure make sure the final value is an empty array
newFeaturesInLatestVersion = [];
});

function getMount(mountPath) {
mountPath = mountPath || '';
Expand Down

0 comments on commit 8c36e69

Please sign in to comment.