var btn, ver;
if (currentDisplayMode === 'updates') {
- var avail = packages.available.pkgs[name];
+ var avail = packages.available.pkgs[name],
+ inst = packages.installed.pkgs[name];
+
+ if (!inst || !inst.installed)
+ continue;
+
if (!avail || compareVersion(avail.version, pkg.version) <= 0)
continue;
}, _('Upgradeā¦'));
}
else if (currentDisplayMode === 'installed') {
+ if (!pkg.installed)
+ continue;
+
ver = truncateVersion(pkg.version || '-');
btn = E('div', {
'class': 'btn cbi-button-negative',
}, _('Remove'));
}
else {
+ var inst = packages.installed.pkgs[name];
+
ver = truncateVersion(pkg.version || '-');
- if (!packages.installed.pkgs[name])
+ if (!inst || !inst.installed)
btn = E('div', {
'class': 'btn cbi-button-action',
'data-package': name,
'click': handleInstall
}, _('Installā¦'));
- else if (packages.installed.pkgs[name].version != pkg.version)
+ else if (inst.installed && inst.version != pkg.version)
btn = E('div', {
'class': 'btn cbi-button-positive',
'data-package': name,