Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #30 from fxos/bug-1175385-no-apps
Browse files Browse the repository at this point in the history
Bug 1175385 - Add message to upload view when no uploadable apps found
  • Loading branch information
mikehenrty committed Jun 17, 2015
2 parents 09bca5c + 6000ce0 commit a327bd0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/js/view/upload_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ export default class UploadView extends View {
}
req.onsuccess = () => {
var apps = req.result;
var atLeastOneEligibleApp = false;
apps.forEach(app => {
if (this.isEligible(app)) {
atLeastOneEligibleApp = true;
var item = document.createElement('li');
var icon = this.getIconUrl(app.manifest, app.origin);
item.classList.add('item');
Expand All @@ -86,6 +88,14 @@ export default class UploadView extends View {
item.addEventListener('click', this.showForm.bind(this, app));
}
});

// Inform user if we did not find any uploadable apps.
if (!atLeastOneEligibleApp) {
var item = document.createElement('li');
item.textContent = 'No apps or addons to upload.';
this.list.appendChild(item);
return;
}
};
req.onerror = e => {
console.log('Unable to fetch installed apps.', e);
Expand Down

0 comments on commit a327bd0

Please sign in to comment.