diff --git a/src/js/client.js b/src/js/client.js index 926c6c79c..37425123b 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -375,9 +375,7 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N // put new app with amended title in cache data.manifest = { title: title }; - var icons = that.getAppIconUrls(data); - data.iconUrl = icons.cloudron; - data.iconUrlStore = icons.store; + data.iconUrl = data.iconUrl ? (that.apiOrigin + data.iconUrl + '?access_token=' + token) : null; data.progress = 0; callback(null, data.id); @@ -1015,13 +1013,6 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N return appFound; }; - Client.prototype.getAppIconUrls = function (app) { - return { - cloudron: app.iconUrl ? (this.apiOrigin + app.iconUrl + '?access_token=' + token) : null, - store: app.appStoreId ? (this._config.apiServerOrigin + '/api/v1/apps/' + app.appStoreId + '/versions/' + app.manifest.version + '/icon') : null - }; - }; - Client.prototype.createInvite = function (userId, callback) { post('/api/v1/users/' + userId + '/create_invite', {}, null, function (error, data, status) { if (error) return callback(error); @@ -1406,11 +1397,8 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N }); }; - Client.prototype._appPostProcess = function (app) { - // calculate the icon paths - var icons = this.getAppIconUrls(app); - app.iconUrl = icons.cloudron; - app.iconUrlStore = icons.store; + Client.prototype._appPostProcess = function (app) { // calculate the icon paths + app.iconUrl = app.iconUrl ? (this.apiOrigin + app.iconUrl + '?access_token=' + token) : null; // FIXME have a real message structure, not some string to randomly parse // extract progress percentage diff --git a/src/views/apps.html b/src/views/apps.html index d9149516a..d836cd3e0 100644 --- a/src/views/apps.html +++ b/src/views/apps.html @@ -478,15 +478,8 @@ function imageErrorHandler(elem) { 'use strict'; - var appstoreIconUrl = elem.getAttribute('appstore-icon'); - var fallbackIconUrl = elem.getAttribute('fallback-icon'); - - if (elem.src === appstoreIconUrl) { - elem.src = fallbackIconUrl; - elem.onerror = null; // avoid retry after default icon cannot be loaded - } else { - elem.src = appstoreIconUrl; - } + elem.src = elem.getAttribute('fallback-icon'); + elem.onerror = null; // avoid retry after default icon cannot be loaded } @@ -528,7 +521,7 @@