Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bug fixed installing an app twice results in 2 icons on the homescreen #22

Merged
merged 1 commit into from

1 participant

@crdlc
Owner

Bug fixed installing an app twice results in 2 icons on the homescreen

https://github.com/mozilla-b2g/gaia/issues/1763

@crdlc crdlc merged commit 4160721 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 18, 2012
  1. @crdlc
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 10 deletions.
  1. +12 −10 apps/homescreen/js/appmanager.js
View
22 apps/homescreen/js/appmanager.js
@@ -35,18 +35,20 @@ var Applications = (function() {
installer.oninstall = function install(event) {
var app = event.application;
- installedApps[app.origin] = app;
+ if (!installedApps[app.origin]) {
+ installedApps[app.origin] = app;
- var icon = getIcon(app.origin);
- if (icon) {
- window.applicationCache.mozAdd(icon);
- }
-
- callbacks.forEach(function(callback) {
- if (callback.type == 'install') {
- callback.callback(app);
+ var icon = getIcon(app.origin);
+ if (icon) {
+ window.applicationCache.mozAdd(icon);
}
- });
+
+ callbacks.forEach(function(callback) {
+ if (callback.type == 'install') {
+ callback.callback(app);
+ }
+ });
+ }
};
document.documentElement.lang = 'en-US';
Something went wrong with that request. Please try again.