From a90cc5f1603302325615456c8b654c52863ca60a Mon Sep 17 00:00:00 2001 From: axolotle Date: Tue, 18 Oct 2022 19:38:56 +0200 Subject: [PATCH] applist: fix apps label and name --- app/src/views/app/AppList.vue | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/app/src/views/app/AppList.vue b/app/src/views/app/AppList.vue index 27e1931b..f156b240 100644 --- a/app/src/views/app/AppList.vue +++ b/app/src/views/app/AppList.vue @@ -68,25 +68,8 @@ export default { return } - const multiInstances = {} - this.apps = apps.map(({ id, name, description, permissions, manifest }) => { - // FIXME seems like some apps may no have a label (replace with id) - const label = permissions[id + '.main'].label - // Display the `id` of the instead of its `name` if multiple apps share the same name - if (manifest.multi_instance) { - if (!(name in multiInstances)) { - multiInstances[name] = [] - } - const labels = multiInstances[name] - if (labels.includes(label)) { - name = id - } - labels.push(label) - } - if (label === name) { - name = null - } - return { id, name, description, label } + this.apps = apps.map(({ id, name, description, manifest }) => { + return { id, name: manifest.name, label: name, description } }).sort((prev, app) => { return prev.label > app.label ? 1 : -1 })