Skip to content

Commit 1969a0e

Browse files
authored
fix: Gracefully fail when trying to get new features in latest version of dashboard (#2880)
1 parent 92ce7a5 commit 1969a0e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Parse-Dashboard/app.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,22 @@ let newFeaturesInLatestVersion = [];
1414
* Gets the new features in the latest version of Parse Dashboard.
1515
*/
1616
async function getNewFeaturesInLatestVersion() {
17-
// Get latest version
18-
const packageJson = (await import('package-json')).default;
19-
const latestPackage = await packageJson('parse-dashboard', { version: 'latest', fullMetadata: true });
20-
2117
try {
18+
// Get latest version
19+
const packageJson = (await import('package-json')).default;
20+
const latestPackage = await packageJson('parse-dashboard', { version: 'latest', fullMetadata: true });
21+
2222
if (latestPackage.parseDashboardFeatures instanceof Array) {
2323
newFeaturesInLatestVersion = latestPackage.parseDashboardFeatures.filter(feature => {
2424
return currentVersionFeatures.indexOf(feature) === -1;
2525
});
2626
}
2727
} catch {
28+
// Fail silently if fetching the latest package information fails
2829
newFeaturesInLatestVersion = [];
2930
}
3031
}
31-
getNewFeaturesInLatestVersion()
32+
getNewFeaturesInLatestVersion().catch(() => {})
3233

3334
function getMount(mountPath) {
3435
mountPath = mountPath || '';

0 commit comments

Comments
 (0)