Simplify app icon handling

Previously we even attempted to use an appstore origin icon
This commit is contained in:
Johannes Zellner
2019-04-03 14:43:20 +02:00
parent 1c946a438d
commit ff0d6b658b
2 changed files with 6 additions and 25 deletions

View File

@@ -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